We should avoid creating `HttpClient`
jovinson-ms opened this issue · 5 comments
We should consider injecting IHttpClientFactory
instead: https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests
Please assign this to me. Probably will not need a unit test for this, since the constructor is not called anywhere in the code, is just used to instantiate the HttpClient class.
Thanks.
Great! You can remove the IDisposable
implementation once we we're using the factory, and the existing tests should continue to pass.
Yes, I had a problem only with tests related to the SQL Server database, but is not because I changed the implementation, is only because I didn't create a SQL connection.
Wellington (@wbalbo), I want to thank you so much for your contribution! I know this issue is closed, but I really hope I reach you with this thank you. :-) I'm the Director, Medical Imaging helping build this product, and I was so happy to see you engaged and working on making this product better. Thank you, Wellington! Your contribution is greatly appreciated! (Hit me up on LinkedIn if you like. I'm Steven Borg, and should be pretty easy to find.)
Wellington (@wbalbo), I want to thank you so much for your contribution! I know this issue is closed, but I really hope I reach you with this thank you. :-) I'm the Director, Medical Imaging helping build this product, and I was so happy to see you engaged and working on making this product better. Thank you, Wellington! Your contribution is greatly appreciated! (Hit me up on LinkedIn if you like. I'm Steven Borg, and should be pretty easy to find.)
Hey Steven, thank you for your kind words, I really appreciate it, seriously!
I saw that you are following me here so I just followed you.
I will add you on LinkedIn too, thanks, hope I can help more in the future!