Expression.MakeBinary Method (ExpressionType, Expression, Expression, Boolean, MethodInfo, LambdaExpression)


Creates a BinaryExpression, given the left operand, right operand, implementing method and type conversion function, by calling the appropriate factory method.

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

Public Shared Function MakeBinary (
	binaryType As ExpressionType,
	left As Expression,
	right As Expression,
	liftToNull As Boolean,
	method As MethodInfo,
	conversion As LambdaExpression
) As BinaryExpression


Type: System.Linq.Expressions.ExpressionType

The ExpressionType that specifies the type of binary operation.

Type: System.Linq.Expressions.Expression

An Expression that represents the left operand.

Type: System.Linq.Expressions.Expression

An Expression that represents the right operand.

Type: System.Boolean

true to set IsLiftedToNull to true; false to set IsLiftedToNull to false.

Type: System.Reflection.MethodInfo

A MethodInfo that specifies the implementing method.

Type: System.Linq.Expressions.LambdaExpression

A LambdaExpression that represents a type conversion function. This parameter is used only if binaryType is Coalesce or compound assignment..

Return Value

Type: System.Linq.Expressions.BinaryExpression

The BinaryExpression that results from calling the appropriate factory method.

Exception Condition

binaryType does not correspond to a binary expression node.


left or right is null.

The binaryType parameter determines which BinaryExpression factory method this method will call. For example, if binaryType is Subtract, this method invokes Subtract. The liftToNull, method and conversion parameters are ignored if the appropriate factory method does not have a corresponding parameter.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top