Class E203_SeedVolume_ef
EF Core twin of : seeds the same employees, arranged as the same reporting
tree, into the flat database, with EF Core's own means only.
Same generator (E000_BulkInsert.CreateEmployees, deterministic), same batch size, same tree
(every manager has direct reports), same environment variables. What is
EF's own: the business class is mapped to the entity graph by hand (),
each batch is one unit of work in a new context with change tracking on, written by
SaveChangesAsync; keys come from the database sequence. No bulk copy, no raw SQL in the
measured part.
dotnet run --project redb.Examples -- E203_ef
REDB_SEED_COUNT=20000 dotnet run --project redb.Examples -- E203_ef
Like E203, it seeds only when named on the command line, appends and never clears.
[ExampleMeta("E203_ef", "EF: seed volume, employees as a reporting tree", "Setup", ExampleTier.Pro, 200, new string[] { "Setup", "BulkInsert", "Tree", "Benchmark", "EF" })]
public class E203_SeedVolume_ef : EfExampleBase
Inheritance
Inherited Members
Methods
RunEfAsync(IDbContextFactory<FlatContext>)
Runs the example through EF Core.
public override Task<ExampleResult> RunEfAsync(IDbContextFactory<FlatContext> contexts)