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