Jul 01, 2019 02:28 PM|mgebhard|LINK
I will try at home and let you know. I don't understand why would I need to inject httpclient into my contoller. Since I am calling the 3rd party web service in the business service layer, what is the point? I am using Unity for Io
I don't understand why being at home makes a bit of difference or how you came to this conclusion.
Edit: as you reveal more code, we find more issues. The Actions are not aysnc. Async programming needs to be implemented from the top bottom. Please follow the openly published the async/await programming.
The HttpClient is designed for use globally in an application. This is information is covered in the linked documentation in my initial post. Please take the time to read the reference documentation so you understand how the API works and its intended
purpose. This will help you correctly design logic.
IoC containers manage variable scope. It is common to see the HttpClient in a Singleton scope managed by an IoC rather than instantiated many times in a static method. Again this is fairly open information and well documented. It seems you are throwing
design patterns and APIs at a very simple programming problem. Most of your time and posts are related to learning/troubleshooting design pattern rather than solving the actual problem.