Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor CRUD scaffolder should add the EF Core migrations endpoint #2592

Open
danroth27 opened this issue Dec 5, 2023 · 1 comment
Open

Comments

@danroth27
Copy link
Member

danroth27 commented Dec 5, 2023

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.
@deepchoudhery
Copy link
Contributor

sounds good, will aim for 8.0.1 timeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants