Ejemplo n.º 1
0
        public static async Task <CustomerAddressResult> GetCustomerAddress(string url)
        {
            CustomerAddressResult objData = new CustomerAddressResult();

            try
            {
                using (var client = new HttpClient())
                {
                    client.BaseAddress = new Uri(url);
                    var result = await client.GetAsync(url);

                    var place = result.Content.ReadAsStringAsync().Result;
                    objData = JsonConvert.DeserializeObject <CustomerAddressResult>(await result.Content.ReadAsStringAsync());
                }
            }
            catch (Exception ex)
            {
            }
            return(objData);
        }
Ejemplo n.º 2
0
 public GetAccountAddressesResponse(CustomerAddressResult apiResult) : this()
 {
     apiResult.CustomerAddresses.ForEach(apiAddress => Addresses.Add(new AccountAddress(apiAddress)));
 }