-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Improve developer experience of AddCodeFirstGrpcClient
#298
Comments
The returned |
But you typically add only one Besides, I alternatively suggested to add extension methods supporting the return type that developers like me require instead of only replacing the existing one's return types. |
This assumption may be true for you but wrong for me.
But Grpc Client has more in common with Anyway, I'm not a maintainer nor a contributor here. I'm just giving you my opinion. |
You're probably doing it wrong then. 1 Furthermore, due to the way
It's not even close to "specific use case": basically, I'm requesting support for using fluent API / method chaining - which is one of the very common patterns used in
Understood. Still, I disagree. Almost completely. |
Well, changing the return type is also a bad developer experience, as it will break existing code. We could add a second method, but since this all works as extension methods, you could add your own extension method that reshapes the API? Thoughts, then; should I add a second method? And if so, what should I call it? |
Agreed about the changed return type - adding a second method is preferred on my end, too. Regarding the naming, because yes, I absolutely vote in favor of adding it: since the signature changes & the compiler is therefore still able to differentiate between them easily, I'd suggest to name it just like the others, i. e |
Currently, the typical method chaining within
Program.cs
requires this:Changing
AddCodeFirstGrpcClient
's /AddGrpcClient<T>
's return type fromIHttpClientBuilder
toIServiceCollection
would improve this in 2 ways:AddAuthorization
,AddLogging
,AddScoped
, etc. - which usually just return theIServiceCollection
instance they extend..Services
suffixes in those typical chained method calls - which gets quite important for micro-service architectures with plenty of gRPC services, e. g.:The text was updated successfully, but these errors were encountered: