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