public void Patch(string id, [FromBody] MergePatchStatusItemDto value) { try { StatusItemsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _statusItemApplicationService.When(value as IMergePatchStatusItem); } catch (Exception ex) { var response = StatusItemsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteStatusItemDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; StatusItemsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _statusItemApplicationService.When(value as IMergePatchStatusItem); return; } // /////////////////////////////// StatusItemsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _statusItemApplicationService.When(value as ICreateStatusItem); } catch (Exception ex) { var response = StatusItemsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }