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