Exemplo n.º 1
0
        /// <summary>
        /// Search Top 3 Post by Key | Content of Post
        /// </summary>
        /// <param name="textSearch"></param>
        /// <returns></returns>
        public IActionResult SearchTop3PostByKey(string textSearch)
        {
            var data = PostProcess.SearchTop3PostByKey(textSearch);
            List <PostModel> listPost = new List <PostModel>();

            foreach (var item in data)
            {
                listPost.Add(new PostModel
                {
                    PostID       = item.PostID,
                    ProfileID    = item.ProfileID,
                    PostContent  = item.PostContent,
                    PostDate     = item.PostDate,
                    NoOfCmts     = item.NoOfCmts,
                    NoOfLikes    = item.NoOfLikes,
                    ProfileName  = item.ProfileName,
                    ProfileImage = item.ProfileImage
                });
            }
            return(View(listPost));
        }