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