Open
Description
Is your feature request related to a problem? Please describe.
I want to used Keyed Services feature with named grpc clients. Right now i have something like this:
serviceCollection.AddGrpcClient<MyGrpcServiceClient>("custom_name", o =>
{
o.Address = new Uri(someUrl);
});
But to access this named client i have to inject GrpcClientFactory
and all Create
on it. In .NET 9 IHttpClientBuilder
introduced AddAsKeyed
that does exactly that for http clients, but it seems to be ignored for grpc clients.
Describe the solution you'd like
What i would love to have is that i can inject my named client directly like that:
app.MapGet("/", ([FromKeyedServices("custom_name")] MyGrpcServiceClient client) => ... );