예제 #1
0
        /// <summary>
        ///     Appends the specified predicate.
        /// </summary>
        /// <param name="predicate">The predicate.</param>
        /// <param name="type">The 类型.</param>
        public IPredicateQuery <TEntity> Append(Expression <Func <TEntity, bool> > predicate, PredicateLinkType type)
        {
            if (predicate == null)
            {
                throw new ArgumentNullException(nameof(predicate));
            }

            _predicateList.Add(new PredicateQueryItem(predicate, type));
            return(this);
        }
예제 #2
0
        /// <summary>
        ///     Appends the specified predicate query.
        /// </summary>
        /// <param name="predicateQuery">The predicate query.</param>
        /// <param name="type">The 类型.</param>
        public IPredicateQuery <TEntity> Append(IPredicateQuery <TEntity> predicateQuery, PredicateLinkType type)
        {
            if (predicateQuery == null)
            {
                throw new ArgumentNullException(nameof(predicateQuery));
            }

            return(Append(predicateQuery.BuildPredicateExpression(), type));
        }
예제 #3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="PredicateQueryItem" /> class.
 /// </summary>
 /// <param name="predicate">The predicate.</param>
 /// <param name="type">The 类型.</param>
 public PredicateQueryItem(Expression <Func <TEntity, bool> > predicate, PredicateLinkType type)
 {
     Predicate = predicate;
     Type      = type;
 }