Skip to content
This repository has been archived by the owner on Dec 8, 2018. It is now read-only.

Fix Apply Migrations button #270

Merged
merged 1 commit into from
Apr 18, 2016
Merged

Fix Apply Migrations button #270

merged 1 commit into from
Apr 18, 2016

Conversation

rowanmiller
Copy link
Contributor

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 dotnet/efcore#4742

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 dotnet/efcore#4742
@@ -26,7 +25,7 @@ public static IApplicationBuilder UseDatabaseErrorPage(this IApplicationBuilder
throw new ArgumentNullException(nameof(app));
}

return app.UseMiddleware<DatabaseErrorPageMiddleware>();
return app.UseDatabaseErrorPage(new DatabaseErrorPageOptions());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious - why didn't the old code work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like MigrationsEndPointMiddleware was never wired up on this code path. The error page would show up, but the endpoint to apply migrations was never added.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the migrations end point is a separate piece of middleware. The overload we now delegate to adds both pieces of middleware.

@natemcmaster
Copy link
Contributor

:shipit:

@rowanmiller rowanmiller merged commit a8bb790 into release Apr 18, 2016
@rowanmiller rowanmiller deleted the migfix branch April 18, 2016 21:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants