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