IS OF

Determines whether the type of an expression is of the specified type or one of its subtypes.

Syntax

expression IS [ NOT ] OF ( [ ONLY ] type)

Arguments

expression: Any valid query expression to determine the type of.
not: Negates the boolean result of IS OF.
only: Specifies that IS OF returns true only if expression is of type type and not any of one its subtypes.
type: The type to test expression against.

Return Value

true if expression is of type T and T is either a base type, or a derived type of type; null if expression is null at runtime; otherwise, false.

Examples

var esql = "select c from Contacts as c where c is of EmployeeContact";
var q = db.CreateQuery<EmployeeContact>(esql);
var esql = "select c from Contacts as c where c is not of EmployeeContact";
var q = db.CreateQuery<EmployeeContact>(esql);
var esql = "select c from Contacts as c where c is of only EmployeeContact";
var q = db.CreateQuery<EmployeeContact>(esql);

Last edited Mar 13, 2013 at 8:15 AM by ansiboy, version 1

Comments

No comments yet.