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