This documentation is archived and is not being maintained.

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

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

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

public static BinaryExpression MakeBinary(
	ExpressionType binaryType,
	Expression left,
	Expression right,
	bool liftToNull,
	MethodInfo method


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.

Return Value

Type: System.Linq.Expressions.BinaryExpression
The BinaryExpression that results from calling the appropriate factory method.


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 and method parameters are ignored if the appropriate factory method does not have a corresponding parameter.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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