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

Allow specifying service (interface) and implementation when calling AddNpgsqlDbContext #4114

Open
nwoolls opened this issue May 7, 2024 · 0 comments · May be fixed by #4115
Open

Allow specifying service (interface) and implementation when calling AddNpgsqlDbContext #4114

nwoolls opened this issue May 7, 2024 · 0 comments · May be fixed by #4115
Assignees
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Comments

@nwoolls
Copy link

nwoolls commented May 7, 2024

Currently the method AddNpgsqlDbContext only allows for a concrete context type to be specified. This makes it difficult to use with both unit testing and Clean Architecture without jumping through a few additional hoops.

It would be nice of there was an overload to AddNpgsqlDbContext<TContext>() with the signature AddNpgsqlDbContext<TContextService, TContextImplementation>() as there is for most of the existing EF extension methods for DI.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label May 7, 2024
@sebastienros sebastienros self-assigned this May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
2 participants