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