public void Patch(string id, [FromBody] MergePatchAttributeDto value) { try { AttributesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeApplicationService.When(value as IMergePatchAttribute); } catch (Exception ex) { var response = AttributesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(MergePatchAttributeDto c) { var idObj = (c as IMergePatchAttribute).AttributeId; var uriParameters = new AttributeUriParameters(); uriParameters.Id = idObj; var req = new AttributePatchRequest(uriParameters, (MergePatchAttributeDto)c); var resp = await _ramlClient.Attribute.Patch(req); AttributeProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(MergePatchAttributeDto c) { WhenAsync(c).GetAwaiter().GetResult(); }