public async Task <IActionResult> Followings(string id)//Viewing user name { var cuser = await GetCurrentUserAsync(); var user = await _userManager.FindByNameAsync(id); if (user == null) { return(NotFound()); } var followings = await _dbContext .Follows .Include(t => t.Receiver) .Where(t => t.TriggerId == user.Id).ToListAsync(); var model = new FollowingsViewModel { Followings = followings, IsMe = cuser?.Id == user.Id }; await model.Restore(user, 3, _dbContext, await GetCurrentUserAsync()); return(View(model)); }
public ActionResult Following() { var userId = User.Identity.GetUserId(); var followees = _unitOfWork.FollowingRepository.GetMineFollowing(userId); var viewModel = new FollowingsViewModel() { Followees = followees, ShowData = User.Identity.IsAuthenticated, Heading = "Following" }; return(View(viewModel)); }
public ActionResult Following() { var userId = User.Identity.GetUserId(); var followings = _unitOfWork.Followings.GetFollowingForUser(userId); var viewModel = new FollowingsViewModel { Followings = followings, ShowActions = User.Identity.IsAuthenticated, Heading = "Artists I'm Following" }; return(View("Followings", viewModel)); }
public ActionResult Followers() { _userId = User.Identity.GetUserId(); var followers = _context.Followings.Where(f => f.FolloweeId == _userId).Select(u => u.Follower).ToList(); var followees = _context.Followings.Where(f => f.FollowerId == _userId).Select(u => u.Followee).ToList(); var followingsViewModel = new FollowingsViewModel() { Followers = followers, Followees = followees }; return(View(followingsViewModel)); }
//Xem danh sách giang vien dang theo doi public ActionResult Following() { var userId = User.Identity.GetUserId(); var followers = _dbContext.Followings .Where(f => f.FollowerId == userId) .Select(f => f.Followee) .ToList(); var viewModel = new FollowingsViewModel { FollowingLectures = followers }; return(View(viewModel)); }
public ActionResult Following() { var userId = User.Identity.GetUserId(); var artists = _context.Followings .Where(a => a.FollowerId == userId) .Select(a => a.Follower) .ToList(); var viewModel = new FollowingsViewModel { ArtistsFollowed = artists, ShowAction = User.Identity.IsAuthenticated }; return(View("Following", viewModel)); }
// GET: Follows public ActionResult Index() { var userId = User.Identity.GetUserId(); var artists = _context.Followings .Where(f => f.FollowerId == userId) .Select(a => a.Followee) .ToList(); var viewModel = new FollowingsViewModel() { Artists = artists, ShowActions = User.Identity.IsAuthenticated, Heading = "Artists I'm Following" }; return(View(viewModel)); }