microsoft / microsoft/aspire-samples
Update DatabaseMigrations and AspireShop to EF 9
Open
Nobody has claimed this yet.
area-samples
- Dominant language
- C#
- Stars
- 1.2k
- Forks
- 345
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 30
Description
Related to https://github.com/dotnet/aspire/issues/5207
- EnsureDatabaseAsync should be removed as now this is handled well by
MigrateAsync MigrateAsyncshouldn'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
UseAsyncSeedingmethod onDbContextOptionsBuilder. See https://github.com/dotnet/eShop/issues/488 for additional suggestions.
Also, use WaitForResourceAsync(...) when available.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked DatabaseMigrations.MigrationService/ApiDbInitializer.cs at EnsureDatabaseAsync and review the related AspireShop migration and startup paths. Check how MigrateAsync, UseAsyncSeeding, and WaitForResourceAsync are currently used. Done means both samples use the EF 9 migration and seeding patterns without the obsolete explicit wrapping or initialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100