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