Simple specification mechanism.
$ dotnet add package Shuttle.Core.Specificationdotnet add package Shuttle.Core.Specification
Provides a simple ISpecification interface.
A default Specification class is available that accepts a function as a callback for scenarios where an explicit ISpecification implementation may not be warranted:
public Specification(Func<T, bool> function)
The package also provides an IAsyncSpecification interface:
public interface IAsyncSpecification<in T>
{
Task<bool> IsSatisfiedByAsync(T candidate);
}
A default AsyncSpecification class is available that accepts a function as a callback for scenarios where an explicit IAsyncSpecification implementation may not be warranted:
public AsyncSpecification(Func<T, Task<bool>> function)