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