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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Remember.Model
{
public abstract class Specification<T>
{
public bool IsSatisfiedBy(T candidate)
{
return SatisfyingElementsFrom(new[] { candidate }).Any();
}

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

return SatisfyingElementsFrom(candidates.AsQueryable());
}

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

Change log

r393 by nicholas.blumhardt on Jul 05, 2008   Diff
Renamed SatisfyingElementsFrom() in
example.
Go to: 
Project members, sign in to write a code review

Older revisions

r392 by nicholas.blumhardt on Jul 05, 2008   Diff
Started fleshing out example with
NHibernate.Linq.
All revisions of this file

File info

Size: 695 bytes, 25 lines
Hosted by Google Code