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