dotnet / dotnet/efcore

Add APIs for registering keyed EF services in DI

Open
#32,272 6 comments 38 reactions 0 assignees View on GitHub
area-dbcontext consider-for-next-release customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

.NET 8.0 brings [keyed services](https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#keyed-di-services) to DI, allowing multiple services with the same CLR type to be registered in the same service provider. This can be useful for various scenarios, e.g. a read-only and read-write DbContext (same CLR type, different connection strings), possibly restricted multitenancy scenarios, and so on.

This could potentially also be useful for some scenarios in EF's internal service provider...

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.