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