public InfoMuridDbContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder <InfoMuridDbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); InfoMuridDbContextConfigurer.Configure(builder, configuration.GetConnectionString(InfoMuridConsts.ConnectionStringName)); return(new InfoMuridDbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <InfoMuridDbContext>(options => { if (options.ExistingConnection != null) { InfoMuridDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { InfoMuridDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } }