示例#1
0
 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));
 }
示例#2
0
 protected static ExpressionMetadata ApplyNot(ExpressionMetadata expressionMetadata)
 {
     if (expressionMetadata.NodeType == ExpressionMetadataNodeType.Comparison && NotType.ContainsKey(expressionMetadata.ComparisonType))
     {
         expressionMetadata.ComparisonType = NotType[expressionMetadata.ComparisonType];
     }
     return(expressionMetadata);
 }
示例#3
0
 internal static ExpressionMetadata GenerateComparisonExpressionMetadata(ExpressionMetadata left, FilterComparisonType comparisonType, params ExpressionMetadata[] rights)
 {
     return(new ExpressionMetadata()
     {
         NodeType = ExpressionMetadataNodeType.Comparison,
         LeftExpression = left,
         RightExpressions = rights.ToList(),
         ComparisonType = comparisonType
     });
 }
示例#4
0
        private static ExpressionMetadata GenerateIsNullExpressionMetadata(ExpressionMetadata left,
                                                                           FilterComparisonType comparisonType)
        {
            var nullComparisonType = GetNullComparisonType(comparisonType);

            return(new ExpressionMetadata()
            {
                NodeType = ExpressionMetadataNodeType.Comparison,
                LeftExpression = left,
                ComparisonType = nullComparisonType
            });
        }