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