public virtual async Task DeleteContactAsync(string contactId) { await _customerApi.DeleteContactsAsync(new[] { contactId }); //Invalidate cache CustomerCacheRegion.ExpireMember(contactId); }
public override async Task DeleteContactAsync(string contactId) { try { await _customerApi.DeleteContactsAsync(new[] { contactId }); } catch (HttpOperationException ex) { /* Our AutoRestClient throws exception on NoContent status code. * In order not to touch the customer module, we check that the exception status is 'NoContent' * and in this case we continue execution */ if (!ex.Message.Contains(NO_CONTENT, StringComparison.InvariantCulture)) { throw; } } //Invalidate cache CustomerCacheRegion.ExpireMember(contactId); }