public ViewResult ViewProfile(int id) { var user = _userService.GetUser(id); if (user == null) return this.NotFound("NotFound", null); var profile = _profileService.GetProfile(user); UserImage userImage = null; if (profile.ImageID.HasValue) userImage = _imageService.GetUserImage(profile.ImageID.Value); var model = new DisplayProfile(user, profile, userImage); model.PostCount = _postService.GetPostCount(user); model.Feed = _feedService.GetFeed(user); model.UserAwards = _userAwardService.GetAwards(user); return View(model); }
public ViewResult MiniProfile(int id) { var user = _userService.GetUser(id); if (user == null) return View("MiniUserNotFound"); var profile = _profileService.GetProfile(user); UserImage userImage = null; if (profile.ImageID.HasValue) userImage = _imageService.GetUserImage(profile.ImageID.Value); var model = new DisplayProfile(user, profile, userImage); model.PostCount = _postService.GetPostCount(user); return View(model); }