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