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