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

  • Mastering AI Development and Building AI Apps with GitHub Copilot

    Two Microsoft experts explain how GitHub Copilot is evolving from a coding assistant into a broader platform for building, customizing and testing AI-powered developer workflows.

  • VS Code 1.123 Adds Agent Session Sync, 1M Context Windows

    Microsoft released Visual Studio Code 1.123 on June 3, adding agent-focused features, larger model context support, integrated browser updates and a new delay for some automatic extension updates.

  • Copilot Billing Shock Hits Developers

    Developer complaints about GitHub Copilot's new usage-based billing model have centered on unexpectedly rapid AI credit consumption, and neither GitHub nor Microsoft has responded directly to the backlash, though they have previously published guidance to lessen model usage costs.

  • Hands On with GitHub Copilot App Technical Preview: Turning a Blazor Issue into a PR

    GitHub's brand-new Copilot desktop app, in technical preview, handled a small Blazor issue from planning through pull request creation, but the hands-on test also showed why developers still need to verify agent work in the running app before merging.

Subscribe on YouTube