Created
January 24, 2016 17:26
-
-
Save angelovstanton/585526fdd7594805a94f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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