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