feat: builders, specifications
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
namespace Bahla.Domain.Specifications.Base
|
||||
{
|
||||
public abstract class CompositeSpecification<T> : ISpecification<T> where T : class
|
||||
{
|
||||
public abstract bool IsSatisfiedBy(T entity);
|
||||
public ISpecification<T> And(ISpecification<T> other)
|
||||
=> new AndSpecification<T>(this, other);
|
||||
public ISpecification<T> AndNot(ISpecification<T> other)
|
||||
=> new AndNotSpecification<T>(this, other);
|
||||
public ISpecification<T> Not()
|
||||
=> new NotSpecification<T>(this);
|
||||
public ISpecification<T> Or(ISpecification<T> other)
|
||||
=> new OrSpecification<T>(this, other);
|
||||
public ISpecification<T> OrNot(ISpecification<T> other)
|
||||
=> new OrNotSpecification<T>(this, other);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user