ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / DefinitionQuery Class / DefinitionQuery Constructor / DefinitionQuery Constructor(String,String)
The name to assign to the definition query.
The where clause for the definition query.
Example

In This Topic
    DefinitionQuery Constructor(String,String)
    In This Topic
    Creates a new instance of the DefinitionQuery object.
    Syntax
    public DefinitionQuery( 
       string name,
       string whereClause
    )
    Public Function New( _
       ByVal name As String, _
       ByVal whereClause As String _
    )

    Parameters

    name
    The name to assign to the definition query.
    whereClause
    The where clause for the definition query.
    Example
    Create a stream layer with a definition query
    //Must be on the QueuedTask
    var url = "https://geoeventsample1.esri.com:6443/arcgis/rest/services/AirportTraffics/StreamServer";
    var lyrCreateParam = new FeatureLayerCreationParams(new Uri(url))
    {
      IsVisible = true,
      //At 2.x - DefinitionFilter = new CIMDefinitionFilter()
      //{
      //  DefinitionExpression = "RWY = '29L'",
      //  Name = "Runway"
      //}
      DefinitionQuery = new DefinitionQuery(whereClause: "RWY = '29L'", name: "Runway")
    };
    
    var streamLayer = LayerFactory.Instance.CreateLayer<StreamLayer>(lyrCreateParam, map);
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also