Execute() публичный Метод

public Execute ( ) : QueryResult
Результат QueryResult
Пример #1
0
 public static SearchFolder Create(ContentQuery query)
 {
     var folder = new SearchFolder
     {
         _contentQuery = query,
         Children = query.Execute().Nodes.ToArray()
     };
     return folder;
 }
Пример #2
0
 /// <summary>
 /// Gets the groups.
 /// </summary>
 /// <returns>List of group nodes.</returns>
 private List<Node> GetGroups()
 {
     var groups = new List<Node>();
     if (!String.IsNullOrEmpty(GroupQuery))
     {
         var sort = new[] { new SortInfo { FieldName = "Name" } };
         var settings = new QuerySettings {EnableAutofilters = false, EnableLifespanFilter = false, Sort = sort};
         var query = new ContentQuery { Text = GroupQuery, Settings  = settings};
         query.AddClause(string.Format("-Name:({0})", string.Join(" ", RepositoryConfiguration.SpecialGroupNames)));
         var results = query.Execute();
         groups.AddRange(results.Nodes);
     }
     return groups;
 }
Пример #3
0
 public bool HasApprovingItems()
 {
     var hasPermission = false;
     var cq = new ContentQuery();
     cq.Text = "+InFolder:/Root/Sites/Default_Site/Book_Rental_Demo_Site/News* +Approvable:yes +Type:newsarticle";
     var result = cq.Execute(ExecutionHint.ForceIndexedEngine);
     int i = 0;
     var nodeList = result.Nodes.ToList();
     var count = nodeList.Count;
     while (!hasPermission && i<count)
     {
         hasPermission |= nodeList[i].Security.HasPermission(PermissionType.Approve);
         i++;
     }
     return hasPermission;
 }