Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new specification based on the current one combined with the specified specification.
        /// </summary>
        /// <param name="specification">The specification.</param>
        /// <returns>New specification with the current specification combined with the specified specification.</returns>
        /// <exception cref="ArgumentNullException">The <paramref name="specification"/> is <c>null</c>.</exception>
        public Specification <TEntity> And(Specification <TEntity> specification)
        {
            Argument.IsNotNull("specification", specification);

            return(new Specification <TEntity>(Predicate.And(specification.Predicate)));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrSpecification{TEntity}" /> class.
 /// </summary>
 /// <param name="leftSide">The left side.</param>
 /// <param name="rightSide">The right side.</param>
 /// <exception cref="ArgumentNullException">The <paramref name="leftSide"/> is <c>null</c>.</exception>
 /// <exception cref="ArgumentNullException">The <paramref name="rightSide"/> is <c>null</c>.</exception>
 public OrSpecification(Specification <TEntity> leftSide, Specification <TEntity> rightSide)
     : base(leftSide, rightSide, () => leftSide.Predicate.Or(rightSide.Predicate).Compile())
 {
 }