mirror of https://github.com/ogoun/Zero.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
678 B
28 lines
678 B
using System;
|
|
using System.Runtime.Serialization;
|
|
|
|
namespace ZeroLevel.Specification
|
|
{
|
|
[Serializable]
|
|
[DataContract]
|
|
public abstract class BaseSpecification<T> : ISpecification<T>
|
|
{
|
|
public abstract bool IsSatisfiedBy(T o);
|
|
|
|
public ISpecification<T> And(ISpecification<T> specification)
|
|
{
|
|
return new AndSpecification<T>(this, specification);
|
|
}
|
|
|
|
public ISpecification<T> Or(ISpecification<T> specification)
|
|
{
|
|
return new OrSpecification<T>(this, specification);
|
|
}
|
|
|
|
public ISpecification<T> Not()
|
|
{
|
|
return new NotSpecification<T>(this);
|
|
}
|
|
}
|
|
}
|