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