public int VoteUp(Guid key) { var post = Mapper.Map <ForumPost>(userContentService.Get(key)); if (post != null) { post.UpVotes++; userContentService.Save(post); return(post.UpVotes); } return(0); }
public ActionResult ShowThread(Guid postKey) { var items = new List <IUserContent>(); var item = userContentService.Get(postKey); if (item != null) { items.Add(item); items.AddRange(userContentService.GetChildren(item.Key, false)); var forumInfo = new ForumInfo { Posts = Mapper.Map <IEnumerable <ForumPost> >(items), Page = CurrentPage }; return(PartialView("thread", forumInfo)); } return(new HttpNotFoundResult()); }