Ejemplo n.º 1
0
        public async Task <Tasks.Dtos.Task> Handle(GetTaskQuery request, CancellationToken cancellationToken)
        {
            return(await _memoryCache.GetOrCreate(request.Id.ToString(), async options =>
            {
                var task = await _tasksRepository.GetTaskByIdAsync(request.Id);

                if (task == null)
                {
                    throw new NotFoundException();
                }

                return task.ToQueryTask();
            }));
        }