public void ShouldCreateNotEqualExpression() { var factory = new DbExpressionFactory(); DbBinaryExpression binaryExpression; binaryExpression = factory.NotEqual(factory.Constant(1), factory.Constant(2)); ValidateBinaryExpression(binaryExpression, DbBinaryExpressionType.NotEqual); }
/// <summary> /// Implements the operator !=. /// </summary> /// <param name="leftExpression">The left expression.</param> /// <param name="rightExpression">The right expression.</param> /// <returns>A <see cref="DbExpression"/> instance.</returns> public static DbExpression operator !=(DbExpression leftExpression, DbExpression rightExpression) { return(ExpressionFactory.NotEqual( leftExpression.IsNull() ? ExpressionFactory.Constant(null) : leftExpression, rightExpression.IsNull() ? ExpressionFactory.Constant(null) : rightExpression)); }