From a8bb790596f71d05deec503e92c28d3930ccbf28 Mon Sep 17 00:00:00 2001 From: Rowan Miller Date: Mon, 18 Apr 2016 10:38:53 -0700 Subject: [PATCH] :bug: Fix Apply Migrations button During all the changes to how options are handled etc. we ended up where app.UseDatabaseErrorPage() would no longer register the migrations middleware that allows the "Apply Migrations" button to work. Resolves aspnet/EntityFramework#4742 --- .../DatabaseErrorPageExtensions.cs | 5 ++--- .../MigrationsEndPointExtensions.cs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageExtensions.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageExtensions.cs index 958380496d..6646407b11 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageExtensions.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageExtensions.cs @@ -14,8 +14,7 @@ namespace Microsoft.AspNetCore.Builder { /// /// Captures synchronous and asynchronous database related exceptions from the pipeline that may be resolved using Entity Framework - /// migrations. When these exceptions occur an HTML response with details of possible actions to resolve the issue is generated. The - /// options for the middleware are set to display the maximum amount of information available. + /// migrations. When these exceptions occur an HTML response with details of possible actions to resolve the issue is generated. /// /// The to register the middleware with. /// The same instance so that multiple calls can be chained. @@ -26,7 +25,7 @@ namespace Microsoft.AspNetCore.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseMiddleware(); + return app.UseDatabaseErrorPage(new DatabaseErrorPageOptions()); } /// diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointExtensions.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointExtensions.cs index 24ac1dc44a..9f688126a2 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointExtensions.cs +++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointExtensions.cs @@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Builder throw new ArgumentNullException(nameof(app)); } - return app.UseMiddleware(); + return app.UseMigrationsEndPoint(new MigrationsEndPointOptions()); } ///