ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Desktop.Core.Portal Namespace / PortalQueryResultSet<T> Class
The type of data returned by the search as an enumeration of T.
Members Example

In This Topic
    PortalQueryResultSet<T> Class
    In This Topic
    Represents the result of a portal search returning an enumeration of T objects.
    Object Model
    PortalQueryResultSet<T> ClassPortalQueryParameters ClassPortalQueryParameters Class
    Syntax
    public sealed class PortalQueryResultSet<T> 
    Public NotInheritable Class PortalQueryResultSet(Of T) 
    Type Parameters
    T
    The type of data returned by the search as an enumeration of T.
    Example
    Portal: Execute a portal search
    var portal = ArcGISPortalManager.Current.GetPortal(portalUri);
    var owner = portal.GetSignOnUsername();
    var portalInfo = await portal.GetPortalInfoAsync();
    
    //1. Get all web maps
    var query1 = PortalQueryParameters.CreateForItemsOfType(PortalItemType.WebMap);
    
    //2. Get all web maps and map services - include user, organization
    // and "usa" in the title
    var query2 = PortalQueryParameters.CreateForItemsOfTypes(new List<PortalItemType>() {
      PortalItemType.WebMap, PortalItemType.MapService}, owner, "", "title:usa");
    query2.OrganizationId = portalInfo.OrganizationId;
    
    //retrieve in batches of up to a 100 each time
    query2.Limit = 100;
    
    //Loop until done
    var portalItems = new List<PortalItem>();
    while (query2 != null)
    {
      //run the search
      PortalQueryResultSet<PortalItem> results = await portal.SearchForContentAsync(query2);
      portalItems.AddRange(results.Results);
      query2 = results.NextQueryParameters;
    }
    
    //process results
    foreach (var pi in portalItems)
    {
      //Do something with the portal items
    }
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Desktop.Core.Portal.PortalQueryResultSet<T>

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also