public async Task <IList <GetAllTodoListsResponse> > Handle(GetAllTodoListsQuery request, CancellationToken cancellationToken) { _logger.LogInformation("Retrieving all TodoLists"); return(await _todosDbContext.TodoListsWithItems() .ProjectTo <GetAllTodoListsResponse>(_mapper.ConfigurationProvider) .ToListAsync(cancellationToken)); }
public async Task <IActionResult> GetAllTodos([FromQuery] GetAllTodoListsQuery getAllTodoListsQuery) { var result = await _mediator.Send(getAllTodoListsQuery); return(Ok(result)); }