If you run the new Blazor CRUD scaffolder, it doesn't add the EF Core migrations endpoint, which makes it harder to run migrations to set up the database.
Repro steps:
Create a new Blazor Web App with the default options
Add a simple data mode
Run the Blazor CRUD scaffolder
Run the app and browser to the generated Index.razor page
Expected result: EF Core migrations endpoint renders a helpful error message saying you need to run migrations to set up the database.
Actual result: You get a difficult to understand error that EF Core couldn't connect to the database
Proposed fix:
The scaffolder should add the Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore package, add a call to builder.Services.AddDatabaseDeveloperPageExceptionFilter(), and a call to app.UseMigrationsEndPoint() when in the Development environment.
If you run the new Blazor CRUD scaffolder, it doesn't add the EF Core migrations endpoint, which makes it harder to run migrations to set up the database.
Repro steps:
Expected result: EF Core migrations endpoint renders a helpful error message saying you need to run migrations to set up the database. Actual result: You get a difficult to understand error that EF Core couldn't connect to the database
Proposed fix:
builder.Services.AddDatabaseDeveloperPageExceptionFilter()
, and a call toapp.UseMigrationsEndPoint()
when in the Development environment.