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