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