public async Task <IViewComponentResult> InvokeAsync(string username, int page) { List <FollowingViewModel> allFollowing = await this.followingService.ExtractFollowing(username); FollowingPaginationViewModel model = new FollowingPaginationViewModel { Username = username, Followings = allFollowing.ToPagedList(page, GlobalConstants.FollowingCountOnPage), }; return(this.View(model)); }
public async Task <IViewComponentResult> InvokeAsync(string username, int page) { var user = await this.userManager.FindByNameAsync(username); var currentUserId = this.userManager.GetUserId(this.HttpContext.User); List <FollowingViewModel> allFollowing = await this.followingService.ExtractFollowing(user, currentUserId); FollowingPaginationViewModel model = new FollowingPaginationViewModel { Username = username, Followings = allFollowing.ToPagedList(page, GlobalConstants.FollowingCountOnPage), }; return(this.View(model)); }