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