Ejemplo n.º 1
0
        public string GetLikesNames(int postId)
        {
            int         countOfNames = 0;
            string      names        = "";
            List <Like> likes        = _likesRepository.GetListLikesByPostId(postId);

            if (likes.Count() < 10)
            {
                countOfNames = likes.Count();
            }
            if (likes.Count() > 10)
            {
                countOfNames = 10;
            }

            for (int i = 0; i < countOfNames; i++)
            {
                names += likes[i].UserNameWho + "\n";
            }
            return(names);
        }