Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpAgentResult{T}"/> class.
 /// </summary>
 /// <param name="sendArgs">The corresponding <see cref="HttpSendArgs"/>.</param>
 /// <param name="response">The <see cref="HttpResponseMessage"/>.</param>
 /// <param name="overrideValue">The value overriding the internal content deserialization.</param>
 public HttpAgentResult(HttpSendArgs sendArgs, HttpResponseMessage response, T overrideValue = default !) : base(response)
 {
     SendArgs = Check.NotNull(sendArgs, nameof(sendArgs));
     if (Comparer <T> .Default.Compare(overrideValue, default !) != 0)
     {
         _value      = overrideValue;
         _isValueSet = true;
     }
 }
Пример #2
0
 public Task <PostalInfo?> GetPostCodesAsync(RefDataNamespace.Country?country, string?state, string?city) => DataInvoker.Current.InvokeAsync(this, async() =>
 {
     var __dataArgs = HttpSendArgs.Create(_mapper, HttpMethod.Get, $"{country.Code}/{state}/{city}", true);
     return((await _httpAgent.SendMappedResponseAsync <PostalInfo, Model.PostalInfo>(__dataArgs).ConfigureAwait(false)).Value);
 });