示例#1
0
        public async Task <ActionResult> UpdateLabel([FromRoute] int id, [FromBody] LabelUpdateDTO labelDto)
        {
            var request  = new UpdateLabelCommand(User.Identity?.Name, id, labelDto);
            var response = await _mediator.Send(request);

            return(response.Match <ActionResult>(
                       ok => NoContent(),
                       notFound => NotFound()
                       ));
        }
 public UpdateLabelCommand(string?userLogin, int id, LabelUpdateDTO updateDTO) : base(userLogin)
 {
     Id        = id;
     UpdateDTO = updateDTO;
 }