dotnet / dotnet/Scaffolding

Detect use of .NET Aspire DbContext methods & don't add standard DbContext services calls when they're present

Open
#2,590 1 comment 0 reactions 0 assignees View on GitHub
area-scaffolding
Dominant language
C#
Stars
818
Forks
260
Avg merge
1d 8h
Merged PRs (30d)
10

Description

.NET Aspire includes components for using various Entity Framework Core providers. At the moment, the scaffolders that include EF Core aren't aware of the top-level methods that register the `DbContext` with the app's DI and thus add additional calls to add the `DbContext` the non-Aspire way, which leads to [issues](https://github.com/dotnet/aspire/issues/744).

We should consider updating the EF Core scaffolders to detect the use of .NET Aspire and not add the calls to `AddDbContext` in those cases.

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.