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