ArrayLength Method
This documentation is archived and is not being maintained.

Expression.ArrayLength Method

Creates a UnaryExpression that represents getting the length of a one-dimensional array.

Namespace:  System.Linq.Expressions
Assembly:  System.Core (in System.Core.dll)

public static UnaryExpression ArrayLength(
	Expression array
)

Parameters

array
Type: System.Linq.Expressions.Expression

An Expression to set the Operand property equal to.

Return Value

Type: System.Linq.Expressions.UnaryExpression
A UnaryExpression that has the NodeType property equal to ArrayLength and the Operand property equal to array.

ExceptionCondition
ArgumentNullException

array is null.

ArgumentException

array.Type does not represent an array type.

The Type property of array must represent an array type.

The Type property of the resulting UnaryExpression is equal to Int32. The Method property is null, and both IsLifted and IsLiftedToNull are set to false.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Show:
© 2016 Microsoft