public async Task <IActionResult> GetPost([FromRoute] int id) { var command = new GetPostCommand() { Id = id }; return(Ok(await mediator.Send(command))); }
public virtual async Task <IActionResult> Get(int id) { return(await Runsafely(async() => { var getPostCommand = new GetPostCommand(id); var post = await _mediator.Send(getPostCommand); if (post != null) { return Ok(post); } return NotFound(); })); }