private string TranslatePredicates(out int?queryId) { if (_predicates.Count == 0) { queryId = null; return(string.Empty); } Expression expression; if (_predicates.Count == 1) { expression = _predicates.First(); } else { expression = Expression.And(_predicates[0], _predicates[1]); for (var predicateIndex = 2; predicateIndex < _predicates.Count; predicateIndex++) { expression = Expression.And(expression, _predicates[predicateIndex]); } } expression = PredicateOperandAligner.Align(expression); expression = PredicateDenormalizer.Denormalize(expression); expression = ConditionalNullRemoverVisitor.RemoveReferenceTypeNullChecks(expression); expression = ODataExpressionWithNullableFieldVisitor.StripAwayOuterTrueCheck(expression); expression = WildcardInserter.Insert(expression); if (_ncoreVersion.SupportFieldQuoting()) { expression = ConstantQuotifier.Quotify(expression); } return(PredicateTranslator.Translate(expression, out queryId)); }
public static Expression StripAwayOuterTrueCheck(Expression expression) { var visitor = new ODataExpressionWithNullableFieldVisitor(); return(visitor.Visit(expression)); }