public void Patch(string id, [FromBody] MergePatchAttributeSetDto value) { try { AttributeSetsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeSetApplicationService.When(value as IMergePatchAttributeSet); } catch (Exception ex) { var response = AttributeSetsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteAttributeSetDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); AttributeSetsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeSetApplicationService.When(value as IDeleteAttributeSet); } catch (Exception ex) { var response = AttributeSetsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteAttributeSetDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; AttributeSetsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeSetApplicationService.When(value as IMergePatchAttributeSet); return; } // /////////////////////////////// AttributeSetsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _attributeSetApplicationService.When(value as ICreateAttributeSet); } catch (Exception ex) { var response = AttributeSetsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }