Project Description

Spec Pattern is a simple yet powerful implementation of specification pattern in C#.

IMPORTANT: Repository is now at Github: https://github.com/jorgehmv/SpecPattern


Relying in IQueryable it covers the three requirements this patterns aims to solve

- Validation
- Querying
- Building

Example

// Check if project is either cool or popular but it should be trustable
var atLeastTrustableSpec = (coolProjectSpec | popularProjectSpec)
                                   & trustableProjectSpec ;
atLeastTrustableSpec.IsSatisfiedBy(project);

// Use the same specs but now to query database with an ORM
var allGreatBuUnpopularProjects = Repository.Query<Project>()
                                  .Where(greatButUnpopularSpec.Predicate);

Last edited Jul 9, 2013 at 8:36 PM by jorgehmv, version 5