I received feedback:
"code test is not at the expected level there's a lack of understanding of async, HTTP clients, and just software development patterns in general. Poor structure and testing"
The simple test and solution are on GitHub https://github.com/sasa-yovanovicc/weatherapi
I'll really appreciate any help to understand what is wrong because the code works, the test works,, and covers all solutions, and honestly, I don't know what they expect.
I understand that in OOP code can be more abstracted and complex, but I can't see any purpose in making code more complex than needed to solve a given problems.
There are few improvements which can be made, that will not only follow modern practices, but simplify the code in some cases:
Use
IHttpClientFactory(previously instantiatingHttpClientper request was considered a bad practice - see here and here why, though now situation was improved, also see this). For possible usage patterns check the docsUse strongly-typed configs for example with options pattern
There is literally no reason to use
GetAwaiter().GetResult()in your code, for example inWeatherController: