Expression.Type 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 Expression이 나타내는 식의 정적 형식을 가져옵니다.
public:
virtual property Type ^ Type { Type ^ get(); };
public:
property Type ^ Type { Type ^ get(); };
public virtual Type Type { get; }
public Type Type { get; }
member this.Type : Type
Public Overridable ReadOnly Property Type As Type
Public ReadOnly Property Type As Type
속성 값
식의 정적 형식을 나타내는 Type입니다.
설명
식 NodeType 트리 노드의 형식인 반면 Type 노드가 나타내는 식의 정적 CLR(공용 언어 런타임) 형식을 나타냅니다. 예를 들어 다른 노드 형식을 가진 두 노드는 다음 코드 예제와 같이 같 Type을 수 있습니다.
// Add the following directive to your file:
// using System.Linq.Expressions;
ConstantExpression constExpr = Expression.Constant(5);
Console.WriteLine("NodeType: " + constExpr.NodeType);
Console.WriteLine("Type: " + constExpr.Type);
BinaryExpression binExpr = Expression.Add(constExpr, constExpr);
Console.WriteLine("NodeType: " + binExpr.NodeType);
Console.WriteLine("Type: " + binExpr.Type);
// This code example produces the following output:
//
// NodeType: Constant
// Type: System.Int32
// NodeType: Add
// Type: System.Int32
' Add the following directive to your file:
' Imports System.Linq.Expressions
Dim constExpr As ConstantExpression = Expression.Constant(5)
Console.WriteLine("NodeType: " & constExpr.NodeType.ToString())
Console.WriteLine("Type: " & constExpr.Type.ToString())
Dim binExpr As BinaryExpression = Expression.Add(constExpr, constExpr)
Console.WriteLine("NodeType: " & binExpr.NodeType.ToString())
Console.WriteLine("Type: " & binExpr.Type.ToString())
' This code example produces the following output:
'
' NodeType: Constant
' Type: System.Int32
' NodeType: Add
' Type: System.Int32