Skip to content
Craig Fowler edited this page Mar 5, 2020 · 1 revision

Specification instances may be used to test individual values. They return a value which indicates whether or not that value satisfies the spec.

var overSix = Spec.Expr<int>(x => x > 6);

overSix.Matches(5); // false
overSix.Matches(10); // true

To test a collection of values using a specification, you may wish to look into collection or queryable filtering.

Clone this wiki locally