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