當前位置: 首頁>>代碼示例>>C#>>正文


C# Node.Select方法代碼示例

本文整理匯總了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));
 }
開發者ID:wakkomail,項目名稱:community-framework,代碼行數:10,代碼來源:ForumFactory.cs

示例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();
 }
開發者ID:wakkomail,項目名稱:community-framework,代碼行數:10,代碼來源:ForumFactory.cs

示例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));
 }
開發者ID:wakkomail,項目名稱:community-framework,代碼行數:10,代碼來源:ForumFactory.cs


注:本文中的umbraco.NodeFactory.Node.Select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。