Manipulate Data in the Cloud: ADO.NET Data Services Framework Arithmetic, Logical, and Grouping Filters: Table 2: Apply Arithmetic, Logical, and Grouping Operators as URI Filters.

URI filters correspond to restructured SQL WHERE clauses or LINQ Where query operators. Abbreviations replace arithmetic and logical symbols, which aren't valid in URIs. Use logical or and and operators for compound filters, and apply precedence grouping operators to segment operations. The .../ abbreviation represents the service prefix, such as http://localhost:52660/Northwind.svc/. Italic text is part of the URI query.

Operator Description Example
Arithmetic Operators
add Addition (+) .../Products?$filter=UnitPrice add 10 gt 25
sub Subtraction (-) .../Products?$filter=UnitPrice sub 10 gt 25
mul Multiplication (*) .../Orders?$filter=Freight mul 40 gt 1000
div Division (/) .../Orders?$filter=Freight div 10 eq 5
mod Modulo (%) .../Orders?$filter=Freight mod 10 eq 0
Logical Operators
eq Equal (=) .../Orders?$filter=ShipCountry eq 'USA'
ne Not equal (!= or <>) .../Orders?$filter=ShipCountry ne 'USA'
gt Greater than (>) .../Orders?$filter=UnitPrice gt 100
ge Greater than or equal (>=) .../Orders?$filter=Freight ge 100
lt Less than (<) .../Orders?$filter=Freight lt 100
le Less than or equal (<=) .../Product?$filter=UnitPrice le 50
and Logical and (&&) .../Product?$filter=UnitPrice le 50 and UnitsInStock gt 10
or Logical or (||) .../Product?$filter=UnitPrice le 50 or UnitsInStock gt 10
not Logical negation (!) .../Customers?$filter=not endswith(PostalCode,'50')
Grouping Operators
( ) Precedence grouping .../Product?$filter=(UnitPrice sub 5) gt 10
comments powered by Disqus

Featured

  • VS Code 1.127 Further Integrates Advanced Browser-AI Tech

    Microsoft's July 1 Visual Studio Code update continues a recent push to make the editor's integrated browser a more capable development surface -- and a more useful tool for AI agents.

  • Support Vector Regression with SGD Training Using C#

    Support vector regression can predict numeric values effectively, and this article shows how to implement and train a kernel SVR model in C# using stochastic sub-gradient descent.

  • New GitHub Switch Limits Repo Issue Creation to Collaborators Only

    After publicly touting pull request limits as a way to cut maintainer noise, GitHub is taking the same idea further with a new setting that lets repository admins restrict issue creation to collaborators only.

  • Uno Platform Helps Ship First Stable SkiaSharp 4.0 Release for 2D .NET Graphics

    SkiaSharp 4.148.0 is the first stable v4 release, bringing a newer Skia engine, API cleanup, performance work and a Microsoft-Uno co-maintenance model.

Subscribe on YouTube