public void Patch(string id, [FromBody] MergePatchAttributeUseMvoDto value) { try { AttributeUseMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeUseMvoApplicationService.When(value as IMergePatchAttributeUseMvo); } catch (Exception ex) { var response = AttributeUseMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteAttributeUseMvoDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.AttributeSetVersion = (long)Convert.ChangeType(version, typeof(long)); AttributeUseMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeUseMvoApplicationService.When(value as IDeleteAttributeUseMvo); } catch (Exception ex) { var response = AttributeUseMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteAttributeUseMvoDto value) { try { // /////////////////////////////// if (value.AttributeSetVersion != default(long)) { value.CommandType = CommandType.MergePatch; AttributeUseMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeUseMvoApplicationService.When(value as IMergePatchAttributeUseMvo); return; } // /////////////////////////////// AttributeUseMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeUseMvoApplicationService.When(value as ICreateAttributeUseMvo); } catch (Exception ex) { var response = AttributeUseMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }