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