You are on page 1of 1

$top Example: http://host/service.svc/Orders?$top=20 $orderby Example: http://host/service.svc/Orders?$orderby=OrderDate%20desc $expand Example: http://host/service.svc/Orders?

$expand=OrderLines

String Functions Date Functions


$expand bool substringof(string p0, string p1) int day(DateTime p0)
bool endswith(string p0, string p1) int hour(DateTime p0)
Query •This returns
related content
bool startswith(string p0, string p1) int minute(DateTime p0)
int length(string p0) int month(DateTime p0)
Options with base
elements int indexof(string arg) int second(DateTime p0)
returned. string insert(string p0, int pos, string p1) int year(DateTime p0)
string remove(string p0, int pos) Math Functions
string remove(string p0, int pos, int length) double round(double p0)
$filter string replace(string p0, string find, string decimal round(decimal p0)
replace)
•This restricts the double floor(double p0)
$orderby string substring(string p0, int pos)
set of returned decimal floor(decimal p0)
string substring(string p0, int pos, int
•This sets the order elements. length) double ceiling(double p0)
of the returned string tolower(string p0) decimal ceiling(decimal p0)
elements. Type Functions
string toupper(string p0)
$top string trim(string p0) bool isof(type p0)
string concat(string p0, string p1) bool isof(expression p0, type p1)
•This restricts the <p0> cast(type p0)
number of
<p1> cast(expression p0, type p1)
elements Query Expression Functions

$filter Example: http://host/service.svc/Orders?$filter=Name eq 'Fred'


returned.
$skip Example:
•This skips a http://host/service.svc/Orders?$filter=average(Amount)
number of http://host/service.svc/Customers?$filter=isof('Ns.SpecialCustomer')
elements

(keyPredicate) Example
$skip Example: http://host/service.svc/Orders?$skip=10

When an ADO.NET Data Service applies the query order, it does so in the order This syntax represents the
specified by the following list. If any of the options is missing, the corresponding step entity type instance whose key
http://www.contoso.com/data
is skipped. is equal to the key predicate
$filter $orderby $skip $top $expand service.svc/Customers('ALFKI')
and is within the specified
entity set.
eq Equal
Comparison Expressions

ne Not Equal Example $value


A URI ending in a property may
lt Less Than
append a /$value segment.
$value acts as a dereference
le Less Than or Equal http://www.contoso.com/data
operator and indicates that
service.svc/Customers('ALFKI')/
only the value of the property
gt Greater Than Address/Name/$value
should be returned without
additional metadata or
ge Great Than or Equal surrounding syntax.

ADO.NET Data Services is a way to expose data in a RESTful way ADO.NET

You might also like