dotnet / dotnet/eShop

Upgrade EF to 9.0

Open
#488 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.9k
Forks
3.8k
Avg merge
1d 11h
Merged PRs (30d)
4

Description

EF 9.0 has a [number of significant improvements](https://github.com/dotnet/efcore/issues?q=sort%3Aupdated-desc+is%3Aissue+label%3Aarea-aspire+milestone%3A9.0.0+is%3Aclosed+) for migrations.

- [MigrateDbContextAsync](https://github.com/dotnet/eShop/blob/main/src/Shared/MigrateDbContextExtensions.cs#L31) should no longer use an explicit execution strategy when calling `InvokeSeeder`
- [Seeding](https://github.com/dotnet/eShop/blob/main/src/Shared/MigrateDbContextExtensions.cs#L58) should now be done using the new `UseAsyncSeeding` method on `DbContextOptionsBuilder`

This can be done before https://github.com/dotnet/aspire/issues/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.