Creates a System.Linq.Expressions.BinaryExpression that represents a coalescing operation.
- left
- An System.Linq.Expressions.Expression to set the BinaryExpression.Left property equal to.
- right
- An System.Linq.Expressions.Expression to set the BinaryExpression.Right property equal to.
A System.Linq.Expressions.BinaryExpression that has the Expression.NodeType property equal to ExpressionType.Coalesce and the BinaryExpression.Left and BinaryExpression.Right properties set to the specified values.
The BinaryExpression.Method property of the resulting System.Linq.Expressions.BinaryExpression is null and both BinaryExpression.IsLifted and BinaryExpression.IsLiftedToNull are set to false. The Expression.Type property is equal to the result type of the coalescing operation. The BinaryExpression.Conversion property is null.
The following rules determine the result type:
If left.Type represents a nullable type and right.Type is implicitly convertible to the corresponding non-nullable type, the result type is the non-nullable equivalent of left.Type.
Otherwise, if right.Type is implicitly convertible to left.Type, the result type is left.Type.
Otherwise, if the non-nullable equivalent of left.Type is implicitly convertible to right.Type, the result type is right.Type.