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