public async Task <List <TaskDto> > Handle(GetAllTasksQuery request, CancellationToken cancellationToken)
        {
            var result = await _unitOfWork.Tasks.GetAll();

            return(_mapper.Map <List <TaskDto> >(result.ToList()));
        }
Beispiel #2
0
        public async Task <GetAllTasksResponse> Handle(GetAllTasksQuery request, CancellationToken cancellationToken)
        {
            var tasks = _repository.GetAllTodos().OrderByDescending(t => t.Id);

            return(await Task.Run(() => { return new GetAllTasksResponse(tasks); }));
        }