public void Patch(string id, [FromBody] MergePatchContactMechDto value) { try { ContactMechesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _contactMechApplicationService.When(value as IMergePatchContactMech); } catch (Exception ex) { var response = ContactMechesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(MergePatchContactMechDto c) { var idObj = (c as IMergePatchContactMech).ContactMechId; var uriParameters = new ContactMechUriParameters(); uriParameters.Id = idObj; var req = new ContactMechPatchRequest(uriParameters, (MergePatchContactMechDto)c); var resp = await _ramlClient.ContactMech.Patch(req); ContactMechProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(MergePatchContactMechDto c) { WhenAsync(c).GetAwaiter().GetResult(); }