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