Query Functions (ADO.NET Data Services)

ADO.NET Data Services supports the following functions for use with query options in a query expression. For more information, see Query Expressions (ADO.NET Data Services).

Functions

String Functions

bool substringof(string p0, string p1)

bool endswith(string p0, string p1)

bool startswith(string p0, string p1)

int length(string p0)

int indexof(string arg)

string insert(string p0, int pos, string p1)

string remove(string p0, int pos)

string remove(string p0, int pos, int length)

string replace(string p0, string find, string replace)

string substring(string p0, int pos)

string substring(string p0, int pos, int length)

string tolower(string p0)

string toupper(string p0)

string trim(string p0)

string concat(string p0, string p1)

Date Functions

int day(DateTime p0)

int hour(DateTime p0)

int minute(DateTime p0)

int month(DateTime p0)

int second(DateTime p0)

int year(DateTime p0)

Math Functions

double round(double p0) The round functions are not supported when you create services that use LINQ to SQL.

decimal round(decimal p0)

double floor(double p0)

decimal floor(decimal p0)

double ceiling(double p0)

decimal ceiling(decimal p0)

Type Functions

Type Functions

bool isof(type p0)

bool isof(expression p0, type p1)

<p0> cast(type p0)

<p1> cast(expression p0, type p1)

NoteNote

Types are represented in the query syntax as strings. For example, to return customers that are of Ns.SpecialCustomer type from an entity set, use a URI such as the following: http://www.example.com/service.svc/Customers?$filter=isof('Ns.SpecialCustomer').

Unsupported Functions

Aggregate functions (sum, min, max, avg, and other such functions) are not supported because they change the meaning of the '/' operator to enable traversal through sets. Example: /Customers?$filter=average(Orders/Amount) gt 50.00 is not supported.

ISNULL and COALESCE operators are not defined. There is a null literal that can be used to compare values to null. For example, to return customers whose nullable FavoriteColor property has a value, use a URI such as the following: http://www.example.com/service.svc/Customers?$filter=FavoriteColor%20ne%20null.

See Also

Tags :


Community Content

Nostromo
wrong signature for function indexof

the right signature is:

int indexof(string p0, string p1)

Tags : contentbug

Page view tracker