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

Update DatabaseMigrations and AspireShop to EF 9 #401

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

Update DatabaseMigrations and AspireShop to EF 9 #401

AndriySvyryd opened this issue Aug 7, 2024 · 2 comments

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Aug 7, 2024

Related to dotnet/aspire#5207

  • EnsureDatabaseAsync should be removed as now this is handled well by MigrateAsync
  • MigrateAsync shouldn't be wrapped in a transaction and execution strategy. This is now done internally, and the explicit wrapping can be detrimental in some cases (for migration operations that can't be executed in a transaction).
  • Seeding should be done using the new UseAsyncSeeding method on DbContextOptionsBuilder. See Upgrade EF to 9.0 eShop#488 for additional suggestions.

Also, use WaitForResourceAsync(...) when available.

@DamianEdwards
Copy link
Member

We're not planning on updating the samples in this repo to .NET 9 but rather keeping them targeting .NET 8 but using Aspire 9, as .NET 8 is LTS. Using EF Core 9 lifts dependencies to .NET 9 versions thus pulling the project out of LTS so we'll keep them on EF Core 8 too. I'll leave this open though to track doing this work when we move the samples to .NET 10.

@DamianEdwards DamianEdwards removed this from the 9.0 milestone Nov 7, 2024
@herzkoenig
Copy link

It would be great if you could share the recommended final changes here in this issue if you’re not planning to update the samples.

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

3 participants