本文整理汇总了C#中umbraco.NodeFactory.Node.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Node.Select方法的具体用法?C# Node.Select怎么用?C# Node.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类umbraco.NodeFactory.Node
的用法示例。
在下文中一共展示了Node.Select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReturnAllSubCategoriesInCategory_NodeFactory
/// <summary>
/// Returns a list of all sub categories within a parent category
/// </summary>
/// <param name="categoryNodeId"></param>
/// <returns></returns>
public IEnumerable<ForumCategory> ReturnAllSubCategoriesInCategory_NodeFactory(int categoryNodeId)
{
var subCategories = new Node(categoryNodeId).ChildrenAsList.Where(x => x.NodeTypeAlias == NodeTypeCategory).OrderBy(x => x.SortOrder);
return subCategories.Select(searchResult => Mapper.MapForumCategory(searchResult));
}
示例2: ReturnSumOfVotesInTopic_NodeFactory
/// <summary>
/// Returns the sum of all votes for all posts within a topic
/// </summary>
/// <param name="topicNodeId"></param>
/// <returns></returns>
public int ReturnSumOfVotesInTopic_NodeFactory(int topicNodeId)
{
var posts = new Node(topicNodeId).ChildrenAsList.Where(x => x.NodeTypeAlias == NodeTypePost);
return posts.Select(searchResult => searchResult.GetProperty("forumPostKarma").Value.ToInt32()).Sum();
}
示例3: ReturnAllPostsInTopic_NodeFactory
/// <summary>
/// Returns a list of posts from a parent topic
/// </summary>
/// <param name="topicNodeId"></param>
/// <returns></returns>
public IEnumerable<ForumPost> ReturnAllPostsInTopic_NodeFactory(int topicNodeId)
{
var posts = new Node(topicNodeId).ChildrenAsList.Where(x => x.NodeTypeAlias == NodeTypePost).OrderBy(x => x.CreateDate);
return posts.Select(searchResult => Mapper.MapForumPost(searchResult));
}