Example #1
0
        public ActionResult LoadFollowing(long userId, int pageIndex = 1)
        {
            long            accountId     = Convert.ToInt64(Session["userId"]);
            List <UserInfo> userList      = new List <UserInfo>();
            var             followingList = FollowService.GetFollowingPagerList(userId, 12, pageIndex);

            foreach (var followingId in followingList)
            {
                var user = UserService.GetUserById(followingId);
                userList.Add(new UserInfo
                {
                    Id          = user.Id,
                    FullName    = user.FullName,
                    UserName    = user.UserName,
                    IsFollowing = FollowService.IsFollowing(accountId, followingId),
                    Biography   = user.Biography.Length > 50 ? user.Biography.Substring(0, 50) + "..." : user.Biography,
                    ProfilePic  = user.ProfilePic
                });
            }
            return(Json(new AjaxResult {
                Status = "OK", Data = userList
            }));
        }