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