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