示例#1
0
        public IActionResult Get(int photoId)
        {
            var contains = _photoService.Contains(new Photo {
                Id = photoId
            });

            if (contains)
            {
                IDataResult <Photo> dataResult = _photoService.GetById(photoId);

                if (dataResult.IsSuccessful)
                {
                    var mapResult = _mapper.Map <PhotoForDetailDto>(dataResult.Data);
                    this.CacheFill(mapResult);
                    return(Ok(mapResult));
                }

                return(this.ServerError(dataResult.Message));
            }

            return(NotFound());
        }