public static ExampleDbContext CreateAndSeedDbWithDiForHandlers <TRunner>(this DbContextOptions <ExampleDbContext> options, List <LogOutput> logs = null, IGenericEventRunnerConfig config = null) where TRunner : class { var context = options.CreateDbWithDiForHandlers <ExampleDbContext, TRunner>(logs, config); context.Database.EnsureCreated(); context.SeedTaxAndStock(); return(context); }