public async Task <ActionResult <TodoDto> > GetByIdAsync(Guid id) { var query = new GetTodoByIdQuery(id); var todo = await requestSender.Send(query); return(Ok(todo)); }
public async Task <ActionResult <TodoDto> > GetTodoByIdAsync(Guid id) { var query = new GetTodoByIdQuery(id); var todoDto = await _mediator.Send(query); if (todoDto == null) { return(NotFound()); } return(Ok(todoDto)); }