The following example creates a BinaryExpression object that represents the subtraction of one number from another.
|
' Create a BinaryExpression that represents subtracting 14 from 53.
Dim binaryExpression As System.Linq.Expressions.BinaryExpression = _
System.Linq.Expressions.Expression.MakeBinary( _
System.Linq.Expressions.ExpressionType.Subtract, _
System.Linq.Expressions.Expression.Constant(53), _
System.Linq.Expressions.Expression.Constant(14))
Console.WriteLine(binaryExpression.ToString())
' This code produces the following output:
'
' (53 - 14)
|
|
// Create a BinaryExpression that represents subtracting 14 from 53.
System.Linq.Expressions.BinaryExpression binaryExpression =
System.Linq.Expressions.Expression.MakeBinary(
System.Linq.Expressions.ExpressionType.Subtract,
System.Linq.Expressions.Expression.Constant(53),
System.Linq.Expressions.Expression.Constant(14));
Console.WriteLine(binaryExpression.ToString());
// This code produces the following output:
//
// (53 - 14)
|