Beispiel #1
0
 public ActionResult Index()
 {
     var userRepo = new UserRepository(new DataContext());
     User user = userRepo.GetUserByName(User.Identity.Name);
     ViewBag.Followers = userRepo.FollowersCount(user);
     ViewBag.CurrentUser = user;
     ViewBag.LastMessage = user.Barks.OrderByDescending(o=>o.CreateAt).First();
     //return View(user);
     return View(barkRepository.GetBarksByUser(user.ID).OrderByDescending(t => t.CreateAt));
 }
Beispiel #2
0
        public ActionResult UserDetails()
        {
            var userRepo = new UserRepository(new DataContext());
             User user = userRepo.GetUserByName(User.Identity.Name);
             List<UserFriend> friends = userRepo.FollowersCount(user);

            UserDetailsModel model = new UserDetailsModel { User = user, Followers = friends };

            return PartialView("_SideContents", model);
        }