dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.79k stars 3.19k forks source link

Add APIs for registering keyed EF services in DI #32272

Open roji opened 1 year ago

roji commented 1 year ago

.NET 8.0 brings keyed 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...

ajcvickers commented 12 months ago

Note from triage: do this for AddDbContext and friends, but currently nothing to do in the internal service provider.

stormbreakermerika commented 4 months ago

Is there any idea on this possibly happening or an ETA on it?

roji commented 4 months ago

This issue is in the Backlog milestone. This means that it is not planned for the next release (EF Core 9.0). We will re-assess the backlog following the this release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources. Make sure to vote (👍) for this issue if it is important to you.