Example #1
0
        public UpdatePatchToDoItemCommand CommandToPatch(int id, JsonPatchDocument <UpdateToDoItemCommand> jsonPatchDocument)
        {
            UpdatePatchToDoItemCommand command = new UpdatePatchToDoItemCommand
            {
                ItemId            = id,
                JsonPatchDocument = jsonPatchDocument
            };

            return(command);
        }
        public async Task <ActionResult> PatchToDoItem(int itemId, [FromBody] JsonPatchDocument <UpdateToDoItemCommand> patchDocument)
        {
            UpdatePatchToDoItemCommand command = _patchToDo.CommandToPatch(itemId, patchDocument);

            return(Ok(await _mediator.Send(command)));
        }