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