My favorites | Sign in
Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Remember.Model
{
public abstract class Specification<T>
where T : class
{
public bool IsSatisfiedBy(T candidate)
{
if (candidate == null)
throw new ArgumentNullException("candidate");

return SatisfiersFrom(new[] { candidate }).Any();
}

public IEnumerable<T> SatisfiersFrom(IEnumerable<T> candidates)
{
if (candidates == null)
throw new ArgumentNullException("candidates");

return SatisfiersFrom(candidates.AsQueryable());
}

public abstract IQueryable<T> SatisfiersFrom(IQueryable<T> candidates);
}
}
Show details Hide details

Change log

r392 by nicholas.blumhardt on Jul 05, 2008   Diff
Started fleshing out example with
NHibernate.Linq.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 789 bytes, 29 lines
Hosted by Google Code