Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created January 24, 2016 17:20
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/63b738f1e7f77a0f88e6 to your computer and use it in GitHub Desktop.
Save angelovstanton/63b738f1e7f77a0f88e6 to your computer and use it in GitHub Desktop.
public abstract class Specification<TEntity> : ISpecification<TEntity>
{
public abstract bool IsSatisfiedBy(TEntity entity);
public ISpecification<TEntity> And(ISpecification<TEntity> other)
{
return new AndSpecification<TEntity>(this, other);
}
public ISpecification<TEntity> Or(ISpecification<TEntity> other)
{
return new OrSpecification<TEntity>(this, other);
}
public ISpecification<TEntity> Not()
{
return new NotSpecification<TEntity>(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment