Exemple #1
0
        protected override void VisitAndAlso(Query.Expressions.AndAlsoExpression expression)
        {
            string leftClause = "";

            if (!(expression.Left is TrueExpression))
            {
                var leftVisitor = VisitInner(expression.Left);
                leftClause = leftVisitor.WhereClause;
            }

            string rightClause = "";

            if (!(expression.Right is TrueExpression))
            {
                var rightVisitor = VisitInner(expression.Right);
                rightClause = rightVisitor.WhereClause;
            }


            if (!string.IsNullOrEmpty(leftClause) && !string.IsNullOrEmpty(rightClause))
            {
                whereClause.AppendFormat(string.Format(" (({0}) AND ({1}))", leftClause, rightClause));
            }
            else if (!string.IsNullOrEmpty(leftClause))
            {
                whereClause.AppendFormat(string.Format("({0})", leftClause));
            }
            else if (!string.IsNullOrEmpty(rightClause))
            {
                whereClause.AppendFormat(string.Format("({0})", rightClause));
            }
        }
Exemple #2
0
        protected override void VisitAndAlso(Query.Expressions.AndAlsoExpression expression)
        {
            if (!(expression.Left is TrueExpression))
            {
                VisitInner(expression.Left);
            }

            if (!(expression.Right is TrueExpression))
            {
                VisitInner(expression.Right);
            }
        }
Exemple #3
0
            protected override void VisitAndAlso(Query.Expressions.AndAlsoExpression expression)
            {
                Expression <Func <MediaContent, bool> > leftClause = it => true;

                if (!(expression.Left is TrueExpression))
                {
                    leftClause = VisitInner(expression.Left);
                }

                Expression <Func <MediaContent, bool> > rightClause = it => true;

                if (!(expression.Right is TrueExpression))
                {
                    rightClause = VisitInner(expression.Right);
                }

                LinqExpression = PredicateBuilder.And(LinqExpression, PredicateBuilder.And(leftClause, rightClause));
            }