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

Upgrade EF to 9.0 #488

Open
AndriySvyryd opened this issue Aug 7, 2024 · 0 comments
Open

Upgrade EF to 9.0 #488

AndriySvyryd opened this issue Aug 7, 2024 · 0 comments
Milestone

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Aug 7, 2024

EF 9.0 has a number of significant improvements for migrations.

  • MigrateDbContextAsync should no longer use an explicit execution strategy when calling InvokeSeeder
  • Seeding should now be done using the new UseAsyncSeeding method on DbContextOptionsBuilder

This can be done before dotnet/aspire#5207

Optional changes to illustrate best practices:

  • Add seeding logic that's conditional on the environment (i.e. Development would have more seed data for testing compared to Production)
  • Pass through the name of the target migration to MigrateAsync to add clarity to the code and an additional step that could prevent a migration to be accidentally applied to Production
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