示例#1
0
        public IActionResult WhoToFollow(int?pageNumbar)
        {
            var viewModel = new UsersListViewModel()
            {
                NoUsersWord = "more users left to follow."
            };
            var number = pageNumbar ?? 1;

            ViewBag.PageNum = number;
            var usersToFollow = followersServices.GetUsersToFollow(User);

            viewModel.Users = usersToFollow.ToPagedList(number, 12);
            return(View(viewModel));
        }
示例#2
0
        public async Task <IActionResult> WhoToFollow(int?pageNumbar)
        {
            var viewModel = new UsersListViewModel()
            {
                NoUsersWord = "more users left to follow."
            };
            var number = pageNumbar ?? 1;

            ViewBag.PageNum = number;
            var usersToFollow = await followersServices.GetUsersToFollow <SimpleUserViewModel>(User);

            viewModel.Users = await usersToFollow.ToPagedListAsync(number, 12);

            return(View(viewModel));
        }
        public IActionResult MyProfile(MyProfileViewModel inputModel)
        {
            var userId          = this.userManager.GetUserId(User);
            var whoToFollowList = new UsersListViewModel()
            {
                Users      = followersServices.GetUsersToFollow(User).ToList(),
                UsersCount = ControllerConstants.WhoToFollowPartialFollowerCount,
            };
            var viewModel = new MyProfileViewModel
            {
                CurrentUserInfo       = userServices.GetUserInfo(userId, userId),
                Posts                 = postServices.GetUserPosts(userId, userId, 0),
                IsValidProfilePicture = inputModel.IsValidProfilePicture,
                UserProfileInfo       = userServices.GetUserInfo(userId, userId),
                WhoToFollow           = whoToFollowList
            };

            return(View(viewModel));
        }
        public async Task <IActionResult> MyProfile(MyProfileViewModel inputModel)
        {
            var userId          = this.userServices.GetUserId(User);
            var whoToFollowList = new UsersListViewModel()
            {
                Users      = await followersServices.GetUsersToFollow(User),
                UsersCount = ControllerConstants.WhoToFollowPartialFollowerCount,
            };

            //TODO: Fix the whole logic behind this method because - dont user GetUserInfo
            var viewModel = new MyProfileViewModel
            {
                CurrentUserInfo       = await userServices.GetUserInfo(userId, userId),
                Posts                 = postServices.GetUserPosts(userId, userId, 0),
                IsValidProfilePicture = inputModel.IsValidProfilePicture,
                UserProfileInfo       = await userServices.GetUserInfo(userId, userId),
                WhoToFollow           = whoToFollowList
            };

            return(View(viewModel));
        }