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