-
Notifications
You must be signed in to change notification settings - Fork 816
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
Add AddNpgsqlDataSource with DI service key #5134
Comments
I would be happy to contribute new methods that use keyed DI, my only question is when is the right time to do that? Keyed DI was introduced in .NET 8 Preview 7, but it requires RC1 bits (dotnet/runtime#89509 is a must have). RC1 bits are not available at nuget.org, so my question is when should I send the PR: when they become available (few weeks from now) or when .NET 8 is officially shipped (November)? |
Thanks @adamsitnik! I think once rc1 ships, we're likely to also ship the Npgsql rc1 very soon after that. That point would like be best for doing a PR (so before rc2). Would be great to have a contribution for this! |
@adamsitnik just in case you're still interested in this :) If not I'll try to do it before GA. |
Npgsql.DependencyInjection allows registering an NpgsqlDataSource in DI. .NET 8.0 is adding support for keyed services (docs); we should add AddNpgsqlDataSource overloads which accept a key. This is ideal for registering multiple data sources in the same DI container, and later selecting which one you want via e.g. [FromKeyedServices].
The text was updated successfully, but these errors were encountered: