using System;
using System.Linq.Expressions;
namespace Abp.Specifications
{
///
/// Represents the combined specification which indicates that both of the given
/// specifications should be satisfied by the given object.
///
/// The type of the object to which the specification is applied.
public class AndSpecification : CompositeSpecification
{
///
/// Constructs a new instance of class.
///
/// The first specification.
/// The second specification.
public AndSpecification(ISpecification left, ISpecification right) : base(left, right) { }
///
/// Gets the LINQ expression which represents the current specification.
///
/// The LINQ expression.
public override Expression> ToExpression()
{
return Left.ToExpression().And(Right.ToExpression());
}
}
}