private JsonRestClient(Uri baseUri, JsonRestClientSettings settings) { _baseUri = baseUri ?? throw new ArgumentNullException(nameof(baseUri)); _settings = settings ?? throw new ArgumentNullException(nameof(settings)); ThrowIfInvalidSettings(); }
/// <summary> /// Initializes the instance of <see cref="JsonRestClient"/> type with specified settings. /// </summary> public JsonRestClient(IHttpClientFactory httpClientFactory, Uri baseUri, JsonRestClientSettings settings) : this(baseUri, settings) { if (httpClientFactory == null) { throw new ArgumentNullException(nameof(httpClientFactory)); } _getHttpClient = httpClientFactory.CreateClient; }
/// <summary> /// Initializes the instance of <see cref="JsonRestClient"/> type with specified settings. /// </summary> public JsonRestClient(HttpClient httpClient, Uri baseUri, JsonRestClientSettings settings) : this(baseUri, settings) { if (httpClient == null) { throw new ArgumentNullException(nameof(httpClient)); } _getHttpClient = () => httpClient; }