Пример #1
0
        public object GetLikesCount(int jokeId)
        {
            var repo = new JokesRepository(_connectionString);
            var joke = repo.GetWithLikes(jokeId);

            return(new
            {
                likes = joke.UserJokeLikes.Count(u => u.Like),
                dislikes = joke.UserJokeLikes.Count(u => !u.Like)
            });
        }