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