예제 #1
0
        public async Task <ResultDto> GetSingleAsync(string id, CancellationToken cancellationToken)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException("Id cannot be empty", nameof(id));
            }

            var resultModel = await _resultsRepository.GetProjectionAsync(id, cancellationToken);

            if (resultModel == null)
            {
                throw new NotFoundException(id);
            }

            return(resultModel.ToDto());
        }