public IActionResult Index(TweetUserVM model) { var user = _appUserService.GetByUserName(User.Identity.Name); ViewBag.Image = Path.GetFileName(user.ImagePath); model.Tweets = _tweetService.GetByFollowed(User.Identity.Name).Take(pageSize).ToList(); model.Retweets = _retweetService.GetByFollowed(User.Identity.Name).Take(pageSize).ToList(); return(View(model)); }
public IActionResult Show(Guid Id, TweetUserVM model) { var user = _appUserService.GetByUserName(User.Identity.Name); ViewBag.Image = Path.GetFileName(user.ImagePath); model.Tweet = _tweetService.Get(Id); model.Comments = _commentService.GetByTweet(Id); model.Retweets = _retweetService.GetByTweet(Id); return(View(model)); }
public IActionResult Profile(string userName, TweetUserVM model) { var user = _userService.GetByUserName(userName); var result = _userService.TakipEdiyorMu(userName, User.Identity.Name); if (result == true) { ViewBag.Follow = "UnFollow"; } else { ViewBag.Follow = "Follow"; } model.Retweets = _retweetService.GetByUser(user.Id).Take(PageSize).ToList(); model.Tweets = _tweetService.GetByUsers(user.Id).Take(PageSize).ToList(); model.User = _userService.GetByUserName(user.UserName); return(View(model)); }