Ejemplo n.º 1
0
        /// <summary>
        /// Adds a boolean condition to the SearchCondition with an "OR" operator.	
        /// If the SearchCondition is empty the "OR" operator is not added.	
        /// </summary>
        /// <param name="predicate">Predicate to be added to the SearchCondition. <b>Null</b> is not allowed.</param>
        public void Or(PredicateBase predicate)
        {
            if (predicate == null)
                throw new ArgumentNullException("predicate", Messages.SearchCondition_PredicateMayNotBeNull);

            if (!this.IsEmpty)
                this.predicateExpression.Add(ConditionOperator.Or);

            this.predicateExpression.Add(predicate);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the SearchCondition class.
 /// </summary>
 /// <param name="firstPredicate">First/initial predicate added to the search condition.</param>
 public SearchCondition(PredicateBase firstPredicate)
 {
     Add(firstPredicate);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Adds a boolean condition to the SearchCondition. 
 /// If the SearchCondition is not empty then the expression is added with an "AND" operator.
 /// Essentially, same as <see cref="And(PredicateBase)"/>.
 /// </summary>
 /// <param name="predicate">Predicate to be added to the SearchCondition. <b>Null</b> is not allowed.</param>
 public void Add(PredicateBase predicate)
 {
     And(predicate);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Converts a predicate to a search condition.
 /// </summary>
 /// <param name="predicate">Predicate.</param>
 /// <returns>Search condition which contains the given predicate.</returns>
 public static SearchCondition ToSearchCondition(PredicateBase predicate)
 {
     return new SearchCondition(predicate);
 }