Beispiel #1
0
        public async Task <int> GetLikesCount(Guid photoId, Guid userId)
        {
            var photo = await _photosRepository.GetById(photoId);

            if (photo.UserId != userId)
            {
                throw new ArgumentException("Photo doesn't belong to user");
            }

            return(await _photosRepository.GetLikesCount(photoId));
        }