ADO.NET Data Services URI Operators

Table A-9. Logical operators

Operator

Description

Example

eq

Equal

/Products?$filter='UnitPrice eq 10'

ne

Not equal

/Products?$filter='UnitPrice ne 10'

gt

Greater than

/Products?$filter=UnitPrice gt 10

ge

Greater than or equal to

/Products?$filter=UnitPrice ge 10

lt

Less than

/Products?$filter=UnitPrice lt 10

le

Less than or equal to

/Products?$filter=UnitPrice le 10

and

Logical AND

/Products?$filter=UnitsInStock gt 0 and UnitsOnOrder eq 0

or

Logical OR

/Products?$filter=UnitsInStock eq 0 or UnitsOnOrder gt 0

not

Logical negation

/Products?$filter=not startswith(ProductName, 'Widget')

Table A-10. Math operators

Operator

Description

Example

add

Addition

/Product?$filter=(UnitPrice add 10) gt 100

sub

Subtraction

/Product?$filter=(UnitPrice sub 10) lt 100

mul

Multiplication

/Product?$filter=(UnitPrice mul 2) gt 100

div

Division

/Product?$filter=(UnitPrice div 2) lt 100

mod

Modulo

/Product?$filter=(UnitPrice mod 10) eq 0

Get Data-Driven Services with Silverlight 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.