System.Linq.Expressions.Expression.IsNullConstant C# (CSharp) Method

IsNullConstant() private static method

private static IsNullConstant ( Expression e ) : bool
e Expression
return bool
        private static bool IsNullConstant(Expression e)
        {
            var c = e as ConstantExpression;
            return c != null && c.Value == null;
        }

Usage Example

        private static Expression GetNonNullSide(Expression a, Expression b)
        {
            if (a.IsNullConstant() || a.IsFalseConstant()) return b;
            if (b.IsNullConstant() || b.IsFalseConstant()) return a;

            return null;
        }
All Usage Examples Of System.Linq.Expressions.Expression::IsNullConstant
Expression