public async Task <ActionResult> Update(int id, UpdateIncidentCommand command)
        {
            if (id != command.Id)
            {
                return(BadRequest());
            }

            await Mediator.Send(command);

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <IncidentResource> > UpdateIncidentAsync([FromRoute] int id, [FromBody] UpdateIncidentCommand incidentCommand)
        {
            incidentCommand.Id = id;

            var incidentResource = await _mediator.Send(incidentCommand);

            if (incidentResource == null)
            {
                return(NotFound());
            }

            return(incidentResource);
        }