aspnet/EntityFramework — pull request #524 by rowanmiller (2014-08-12 23:23:20+00:00)
Title: Blue Screen of Curable Illness

Initial cut of middleware to provide a custom error page when a database exception occurs in an ASP.NET vNext. The error page is displayed when there is some action that can be taken with migrations that may fix the error (applying migrations, scaffolding a new migration, etc.). If the action is just applying the existing migrations then we also include the ability to apply them from the page. This makes use of another piece of middleware that can apply migrations.

This functionality will only ever be enabled in local dev mode by default (same as other diagnostics pages for ASP.NET vNext).

This is just an initial cut, things that still need to happen include:
- Better error handling/validation in middleware
- Tests
- Handling context not being registered in DI
- Styling for error page (currently it just has very simple styling largely copied from the existing ASP.NET vNext error page)

The functionality is enabled by adding something like this to Startup.cs. There are overloads that allow you to customize URLs, info that is displayed, etc.
```
app.UseDatabaseErrorPage();
app.UseMigrationsEndPoint();
```

Here is a sample of the page that is displayed
![screenshot](https://cloud.githubusercontent.com/assets/4741851/3899153/10d07f3e-2277-11e4-9355-817146ecbbac.png)