コード例 #1
0
		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);
		}
コード例 #2
0
		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);
		}