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