This documentation is archived and is not being maintained.

Expression.Type Property

Gets the static type of the expression that this Expression represents.

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

public Type Type { get; }

Property Value

Type: System.Type
The Type that represents the static type of the expression.

The NodeType is the type of the expression tree node, whereas the Type represents the static common language runtime (CLR) type of the expression that the node represents. For example, two nodes with different node types can have the same Type:

    // NodeType is Constant; Type is System.Int32.
    ConstantExpression constExpr1 = Expression.Constant(5);
    // NodeType is Add; Type is System.Int32
    BinaryExpression binExpr = Expression.Add(constExpr1, constExpr1);

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