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