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