Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created January 24, 2016 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/585526fdd7594805a94f to your computer and use it in GitHub Desktop.
Save angelovstanton/585526fdd7594805a94f to your computer and use it in GitHub Desktop.
public class AndSpecification<TEntity> : Specification<TEntity>
{
private readonly ISpecification<TEntity> leftSpecification;
private readonly ISpecification<TEntity> rightSpecification;
public AndSpecification(ISpecification<TEntity> leftSpecification, ISpecification<TEntity> rightSpecification)
{
this.leftSpecification = leftSpecification;
this.rightSpecification = rightSpecification;
}
public override bool IsSatisfiedBy(TEntity entity)
{
return this.leftSpecification.IsSatisfiedBy(entity) && this.rightSpecification.IsSatisfiedBy(entity);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment