Table of Contents

Class TypeCheckFunctionsExtensions

Namespace
Microsoft.Azure.Documents.SystemFunctions
Assembly
Microsoft.Azure.Documents.Client.dll

Provide methods for type checking. These methods are to be used in LINQ expressions only and will be evaluated on server. There's no implementation provided in the client library.

public static class TypeCheckFunctionsExtensions
Inheritance
TypeCheckFunctionsExtensions
Inherited Members

Methods

IsArray(object)

Determines if a certain property is of array JSON type.

public static bool IsArray(this object obj)

Parameters

obj object

Returns

bool

Returns true if this property is an array otherwise returns false.

Examples

var isArrayQuery = documents.Where(document => document.Names.IsArray());

IsBool(object)

Determines if a certain property is of boolean JSON type.

public static bool IsBool(this object obj)

Parameters

obj object

Returns

bool

Returns true if this property is a boolean otherwise returns false.

Examples

var isBoolQuery = documents.Where(document => document.Name.IsBool());

IsDefined(object)

Determines if a certain property is defined or not.

public static bool IsDefined(this object obj)

Parameters

obj object

Returns

bool

Returns true if this property is defined otherwise returns false.

Examples

var isDefinedQuery = documents.Where(document => document.Name.IsDefined());

IsNull(object)

Determines if a certain property is null or not.

public static bool IsNull(this object obj)

Parameters

obj object

Returns

bool

Returns true if this property is null otherwise returns false.

Examples

var isNullQuery = documents.Where(document => document.Name.IsNull());

IsNumber(object)

Determines if a certain property is of number JSON type.

public static bool IsNumber(this object obj)

Parameters

obj object

Returns

bool

Returns true if this property is a number otherwise returns false.

Examples

var isNumberQuery = documents.Where(document => document.Amount.IsNumber());

IsObject(object)

Determines if a certain property is of object JSON type.

public static bool IsObject(this object obj)

Parameters

obj object

Returns

bool

Returns true if this property is an object otherwise returns false.

Examples

var isObjectQuery = documents.Where(document => document.Person.IsObject());

IsPrimitive(object)

Determines if a certain property is of premitive JSON type.

public static bool IsPrimitive(this object obj)

Parameters

obj object

Returns

bool

Returns true if this property is null otherwise returns false.

Examples

var isPrimitiveQuery = documents.Where(document => document.Name.IsPrimitive());

Remarks

Premitive JSON types (Double, String, Boolean and Null)

IsString(object)

Determines if a certain property is of string JSON type.

public static bool IsString(this object obj)

Parameters

obj object

Returns

bool

Returns true if this property is a string otherwise returns false.

Examples

var isStringQuery = documents.Where(document => document.Name.IsString());