コード例 #1
0
 public linq.Expression <Func <IEvaluationContext, bool> > GetExpression()
 {
     linq.Expression <Func <IEvaluationContext, bool> > retVal = AllAny.IsAll ? PredicateBuilder.True <IEvaluationContext>() : PredicateBuilder.False <IEvaluationContext>();
     foreach (var adaptor in this.Children.OfType <IExpressionAdaptor>())
     {
         var expression = adaptor.GetExpression();
         if (!AllAny.IsAll)
         {
             retVal = retVal.Or(expression);
         }
         else
         {
             retVal = retVal.And(expression);
         }
     }
     return(retVal);
 }
        public System.Linq.Expressions.Expression <Func <IEvaluationContext, bool> > GetExpression()
        {
            linq.Expression <Func <IEvaluationContext, bool> > retVal = ((IExpressionAdaptor)this.Children[0]).GetExpression();
            foreach (var adaptor in this.Children.OfType <IExpressionAdaptor>())
            {
                var expression = adaptor.GetExpression();
                if (adaptor is PriceListAssignmentExpressionBlock)
                {
                    expression = ((PriceListAssignmentExpressionBlock)adaptor).ConditionBlock.GetExpression();
                    if (!((PriceListAssignmentExpressionBlock)adaptor).ConditionBlock.AndOr.IsAnd)
                    {
                        retVal = retVal.Or(expression);
                    }
                    else
                    {
                        retVal = retVal.And(expression);
                    }
                }
                //else
                //	retVal = retVal.And(expression);
            }

            return(retVal);
        }