/// <summary> /// /// </summary> /// <param name="customer"></param> /// <returns></returns> public async Task<Customer> AddAsync(Customer customer) { var requestUrl = string.Format(BaseUrl, this.StoreId); using (var client = CreateMailClient(requestUrl)) { var response = await client.PostAsJsonAsync(string.Empty, customer).ConfigureAwait(false); await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false); var customerResponse = await response.Content.ReadAsAsync<Customer>().ConfigureAwait(false); return customerResponse; } }
/// <summary> /// The update async. /// </summary> /// <param name="storeId"> /// The store id. /// </param> /// <param name="store"> /// The store. /// </param> /// <returns> /// The <see cref="Task"/>. /// </returns> public async Task<Customer> UpdateAsync(string customerId, Customer customer) { var requestUrl = string.Format(BaseUrl, StoreId); using (var client = CreateMailClient(requestUrl + "/")) { var response = await client.PatchAsJsonAsync(customerId, customer).ConfigureAwait(false); await response.EnsureSuccessMailChimpAsync().ConfigureAwait(false); var customerResponse = await response.Content.ReadAsAsync<Customer>().ConfigureAwait(false); return customerResponse; } }