using Microsoft.EntityFrameworkCore; using Shared.Core.Interfaces.SPI; namespace Shared.Infrastructure.Database { public class MyDbContext : DbContext { private readonly IEnumerable _seeders; public MyDbContext( DbContextOptions options, IEnumerable seeders) : base(options) { _seeders = seeders; } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.ApplyConfigurationsFromAssembly(typeof(MyDbContext).Assembly); DbInitializer.Seed(modelBuilder, _seeders); } } }