Lets say we have code like this:
services.AddHttpClient();
services.AddSingleton<IMyService, MyService>();
...
public class MyService : IMyService
{
public MyService(HttpClient httpClient)
{
}
}
There are questions (probably stupid, but I just want to clear some things):
- Will it use
HttpClientFactoryto create an instance ofHttpClient? - I guess it uses
HttpClientFactorybut will it have issues with DNS changes in that case?
It's not quite clear if HttpMessageHandlers will be managed for singleton services, and should service be scoped anyway to get all benefits of HttpClientFactory usage.