Share via


FindFilter.Expression Property

FindFilter.Expression Property

A complex logical expression (object) used to filter the find results returned by the point-of-interest and polygon find methods.


Public Expression As FilterExpression 


[C#]

public FilterExpression Expression;

Remarks

  • The Expression property and the WhereClause property are mutually exclusive; when both properties are assigned values, an exception is thrown.

  • If the WhereClause and Expression properties are both null, all entities are returned for the FindByID, FindNearby, FindNearRoute, and FindPolygon methods, regardless of their property values. However, an exception is thrown for the FindServiceSoap.FindByProperty method if both the properties are null.

  • The maximum length of the expression text is 2,000 characters.

  • The maximum number of parameters in an expression is 50.

Example

[Visual Basic]

 'Return only the store name and phone number
Dim returnProperties(1) As String
returnProperties(0) = "Name"
returnProperties(1) = "Phone"

Dim findNearbySpec As New FindNearbySpecification()
findNearbySpec.DataSourceName = "MapPoint.FourthCoffeeSample"
findNearbySpec.Distance = 1
findNearbySpec.LatLong = New LatLong()
findNearbySpec.LatLong.Latitude = 47.6
findNearbySpec.LatLong.Longitude = -122.33
findNearbySpec.Filter = New FindFilter()
findNearbySpec.Filter.EntityTypeName = "FourthCoffeeShops"
findNearbySpec.Filter.PropertyNames = returnProperties

Dim foundResults As FindResults
foundResults = findService.FindNearby(findNearbySpec)



[C#]

//Return only the store name and phone number
string[] returnProperties = new string[2];
returnProperties[0] = "Name";
returnProperties[1] = "Phone";

FindNearbySpecification findNearbySpec  = new FindNearbySpecification();
findNearbySpec.DataSourceName = "MapPoint.FourthCoffeeSample";
findNearbySpec.Distance = 1;
findNearbySpec.LatLong = new LatLong();
findNearbySpec.LatLong.Latitude = 47.6;
findNearbySpec.LatLong.Longitude = -122.33;
findNearbySpec.Filter = new FindFilter();
findNearbySpec.Filter.EntityTypeName = "FourthCoffeeShops";
findNearbySpec.Filter.PropertyNames = returnProperties;

FindResults foundResults;
foundResults = findService.FindNearby(findNearbySpec);


See Also

  FilterExpression Class   |   FindFilter Class   |   EntityType.Name Property   |   WhereClause Class   |   FindServiceSoap Class