/// <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()); }
/// <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()); }