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