Exemple #1
0
        public async Task <News> GetNews(Guid newsId, Guid?userId)
        {
            var result = await _feedRepository.GetNewsAsync(newsId);

            if (result == null)
            {
                return(result);
            }
            if (userId.HasValue)
            {
                var like = await _feedRepository.GetFeedLikedDislikedAsync(newsId, userId.Value);

                if (like != null)
                {
                    result.LikedType = like.LikeType;
                }
            }

            return(result);
        }