// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure( IApplicationBuilder app, IWebHostEnvironment env, BudgetDataDbContext budgetDataDbContext, ComprehensiveDataDbContext comprehensiveDataDbContext) { // creates or apply migrations to the databases // remove this if there is an alternative migration strategy budgetDataDbContext.Database.Migrate(); comprehensiveDataDbContext.Database.Migrate(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public async Task InitializeAsync() { using var context = new ComprehensiveDataDbContext(DbContextOptions); await context.Database.EnsureDeletedAsync(); await context.Database.MigrateAsync(); }
public async Task DisposeAsync() { using var context = new ComprehensiveDataDbContext(DbContextOptions); await context.Database.EnsureDeletedAsync(); }
public void CanCreateAndDropDatabase() { using var context = new ComprehensiveDataDbContext(DbContextOptions); }
public ComprehensiveDataWrapper( ComprehensiveDataDbContext comprehensiveDataDbContext) { ComprehensiveDataDbContext = comprehensiveDataDbContext; }