public async Task <ActionResult> Update(int id, UpdateIncidentCommand command) { if (id != command.Id) { return(BadRequest()); } await Mediator.Send(command); return(NoContent()); }
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); }