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

Specifications may be used as parameters when filtering collection or queryable objects, just like with Linq.

The following Linq functions all accept specification objects as parameters, instead of writing the predicate manually. This is achieved via extension methods in the CSF.Specifications namespace.

  • Where
  • First
  • FirstOrDefault
  • Single
  • SingleOrDefault
  • Count
  • Any

Queryable

Objects which are IQueryable<T> may only be filtered by specification expressions.

Collections

Objects which are IEnumerable<T> may be filtered by either specification expressions or functions.

Clone this wiki locally