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