Ejemplo n.º 1
0
 /// <summary>
 /// Returns the post that started the topic
 /// </summary>
 /// <param name="topicNodeId"></param>
 /// <returns></returns>
 public ForumPost ReturnTopicStarterPost_NodeFactory(int topicNodeId)
 {
     var posts = new Node(topicNodeId).ChildrenAsList.Where(x => x.NodeTypeAlias == NodeTypePost && x.GetProperty("forumPostIsTopicStarter").Value == "1");
     return Mapper.MapForumPost(posts.FirstOrDefault());
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns the latest post in a topic
 /// </summary>
 /// <param name="topicNodeId"></param>
 /// <returns></returns>
 public ForumPost ReturnLatestPostInTopic_NodeFactory(int topicNodeId)
 {
     var posts = new Node(topicNodeId).ChildrenAsList.Where(x => x.NodeTypeAlias == NodeTypePost).OrderByDescending(x => x.CreateDate);
     return Mapper.MapForumPost(posts.FirstOrDefault());
 }