/// <summary> ctor </summary> public GeneralHttpClient(ApiServiceNames namedhttpClient, HttpClient httpClient) { _httpClient = httpClient; _namedhttpClient = namedhttpClient; _logger = GeneralContext.GetService <ILogger>(); RequestUrl = $"api/{_namedhttpClient}/"; }
public static GeneralHttpClient CreateRestClient(ApiServiceNames httpClientNamed = ApiServiceNames.DalApi) { IHttpClientFactory httpContextFactory = GetService <IHttpClientFactory>(); var typedHttpClient = httpContextFactory.CreateClient(httpClientNamed.GetDisplayName()); return(new GeneralHttpClient(httpClientNamed, typedHttpClient)); }