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