public ProjectNameDbContext Create(DbContextFactoryOptions options) { var builder = new DbContextOptionsBuilder <ProjectNameDbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); ProjectNameDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ProjectNameConsts.ConnectionStringName)); return(new ProjectNameDbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <ProjectNameDbContext>(configuration => { ProjectNameDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString); }); } }