private static bool CanBeConvertedAsIsNullComparison(ExpressionMetadata left, FilterComparisonType comparisonType, ExpressionMetadata right) { return(right.NodeType == ExpressionMetadataNodeType.Property && right.Parameter.Value == null && left.NodeType == ExpressionMetadataNodeType.Column && (comparisonType == FilterComparisonType.Equal || comparisonType == FilterComparisonType.NotEqual)); }
protected static ExpressionMetadata ApplyNot(ExpressionMetadata expressionMetadata) { if (expressionMetadata.NodeType == ExpressionMetadataNodeType.Comparison && NotType.ContainsKey(expressionMetadata.ComparisonType)) { expressionMetadata.ComparisonType = NotType[expressionMetadata.ComparisonType]; } return(expressionMetadata); }
internal static ExpressionMetadata GenerateComparisonExpressionMetadata(ExpressionMetadata left, FilterComparisonType comparisonType, params ExpressionMetadata[] rights) { return(new ExpressionMetadata() { NodeType = ExpressionMetadataNodeType.Comparison, LeftExpression = left, RightExpressions = rights.ToList(), ComparisonType = comparisonType }); }
private static ExpressionMetadata GenerateIsNullExpressionMetadata(ExpressionMetadata left, FilterComparisonType comparisonType) { var nullComparisonType = GetNullComparisonType(comparisonType); return(new ExpressionMetadata() { NodeType = ExpressionMetadataNodeType.Comparison, LeftExpression = left, ComparisonType = nullComparisonType }); }