public CRMDbContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder <CRMDbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); CRMDbContextConfigurer.Configure(builder, configuration.GetConnectionString(CRMConsts.ConnectionStringName)); return(new CRMDbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <CRMDbContext>(options => { if (options.ExistingConnection != null) { CRMDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { CRMDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <CRMDbContext>(options => { if (options.ExistingConnection != null) { CRMDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { CRMDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } //Uncomment below line to write change logs for the entities below: //Configuration.EntityHistory.Selectors.Add("CRMEntities", typeof(OrganizationUnit), typeof(Role), typeof(Tenant)); }