Expression.Add 메서드

정의

BinaryExpression 오버플로 검사가 없는 산술 추가 작업을 나타내는 연산을 만듭니다.

오버로드

Name Description
Add(Expression, Expression)

BinaryExpression 오버플로 검사가 없는 산술 추가 작업을 나타내는 연산을 만듭니다.

Add(Expression, Expression, MethodInfo)

BinaryExpression 오버플로 검사가 없는 산술 추가 작업을 나타내는 연산을 만듭니다. 구현 메서드를 지정할 수 있습니다.

Add(Expression, Expression)

BinaryExpression 오버플로 검사가 없는 산술 추가 작업을 나타내는 연산을 만듭니다.

public:
 static System::Linq::Expressions::BinaryExpression ^ Add(System::Linq::Expressions::Expression ^ left, System::Linq::Expressions::Expression ^ right);
public static System.Linq.Expressions.BinaryExpression Add(System.Linq.Expressions.Expression left, System.Linq.Expressions.Expression right);
static member Add : System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.BinaryExpression
Public Shared Function Add (left As Expression, right As Expression) As BinaryExpression

매개 변수

left
Expression

Expression 속성을 같게 Left 설정하는 A입니다.

right
Expression

Expression 속성을 같게 Right 설정하는 A입니다.

반품

BinaryExpression 속성이 NodeTypeAddLeft 지정된 값으로 설정된 속성과 Right 속성이 있는 A입니다.

예외

left 또는 right .입니다 null.

더하기 연산자에 대해 left정의되지 않았습니다. 형식 및 right. 형식.

예제

다음 코드 예제에서는 두 개의 정수를 추가하는 식을 만드는 방법을 보여 줍니다.

// Add the following directive to your file:
// using System.Linq.Expressions;

// This expression adds the values of its two arguments.
// Both arguments must be of the same type.
Expression sumExpr = Expression.Add(
    Expression.Constant(1),
    Expression.Constant(2)
);

// Print out the expression.
Console.WriteLine(sumExpr.ToString());

// The following statement first creates an expression tree,
// then compiles it, and then executes it.
Console.WriteLine(Expression.Lambda<Func<int>>(sumExpr).Compile()());

// This code example produces the following output:
//
// (1 + 2)
// 3
' Add the following directive to your file:
' Imports System.Linq.Expressions  

' This expression adds the values of its two arguments.
' Both arguments must be of the same type.
Dim sumExpr As Expression = Expression.Add(
    Expression.Constant(1),
    Expression.Constant(2)
    )

' Print the expression.
Console.WriteLine(sumExpr.ToString())

' The following statement first creates an expression tree,
' then compiles it, and then executes it.            
Console.WriteLine(Expression.Lambda(Of Func(Of Integer))(sumExpr).Compile()())

' This code example produces the following output:
'
' (1 + 2)
' 3

설명

이 API에 대한 자세한 내용은 Expression.Add에 대한 추가 API 비고를 참조하세요.

적용 대상

Add(Expression, Expression, MethodInfo)

BinaryExpression 오버플로 검사가 없는 산술 추가 작업을 나타내는 연산을 만듭니다. 구현 메서드를 지정할 수 있습니다.

public:
 static System::Linq::Expressions::BinaryExpression ^ Add(System::Linq::Expressions::Expression ^ left, System::Linq::Expressions::Expression ^ right, System::Reflection::MethodInfo ^ method);
public static System.Linq.Expressions.BinaryExpression Add(System.Linq.Expressions.Expression left, System.Linq.Expressions.Expression right, System.Reflection.MethodInfo method);
static member Add : System.Linq.Expressions.Expression * System.Linq.Expressions.Expression * System.Reflection.MethodInfo -> System.Linq.Expressions.BinaryExpression
Public Shared Function Add (left As Expression, right As Expression, method As MethodInfo) As BinaryExpression

매개 변수

left
Expression

Expression 속성을 같게 Left 설정하는 A입니다.

right
Expression

Expression 속성을 같게 Right 설정하는 A입니다.

method
MethodInfo

MethodInfo 속성을 같게 Method 설정하는 A입니다.

반품

BinaryExpression 속성이 NodeTypeAdd 고 , LeftRight 속성이 Method지정된 값으로 설정된 A입니다.

예외

left 또는 right .입니다 null.

method 가 아니 null 고 나타내는 메서드가 반환 void되거나, Visual Basic에서 반환되지 않거나 static ,Shared 정확히 두 개의 인수를 사용하지 않습니다.

methodnull 대해 left더하기 연산자가 정의되지 않았습니다. 형식 및 right. 형식.

설명

이 API에 대한 자세한 내용은 Expression.Add에 대한 추가 API 비고를 참조하세요.

적용 대상