public void AddDbContext <TDbContext>(Action <DbContextConfiguration <TDbContext> > action) where TDbContext : DbContext { var dbOptions = new DbContextConfiguration <TDbContext>(string.Empty, null); action(dbOptions); Configure.Services.AddSingleton(dbOptions.DbContextOptions.Options); Configure.Services.AddSingleton(typeof(IDbContextConfigurer <TDbContext>), new DbContextConfigurerAction <TDbContext>(action)); _dbContextTypeMatcher.Populate(new [] { typeof(TDbContext) }); }
public override void Start() { Type[] dbContextTypes = Resolver.GetRegisteredServices().Where(x => typeof(StoveDbContext).IsAssignableFrom(x)).ToArray(); _dbContextTypeMatcher.Populate(dbContextTypes); }
public override void Start() { Type[] dbContextTypes = typeof(StoveDbContext).AssignedTypes().ToArray(); _dbContextTypeMatcher.Populate(dbContextTypes); }