public async Task <IEnumerable <TaskDetailDto> > HandleAsync(FindTaskDetailByAssinee query) { var tasks = await _taskRepository.FindByAssigneeAsync(query.AssigneeId); // Good place to make a linq projection provided by automapper return(tasks.Select(x => new TaskDetailDto(x.Title)).ToList()); }
public async Task <ActionResult <IEnumerable <TaskDetailDto> > > Get([FromQuery] FindTaskDetailByAssinee query) { return(Ok(await _dispatcher.QueryAsync(query))); }