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); }
public GetAccountAddressesResponse(CustomerAddressResult apiResult) : this() { apiResult.CustomerAddresses.ForEach(apiAddress => Addresses.Add(new AccountAddress(apiAddress))); }