danielcrenna/specifications — Issue #1: Specification and IQueryable
Author: shapper
Created: 2011-11-06 18:07:57+00:00
State: open

Hello,

I looked at your Specification implementation and I really like it. I have a few questions:

1 - What about making it possible to verify a collections of items. For example:

public interface ISpecification {
T SatisfiedBy(IQueryable query);
IQueryable SatisfyingEntitiesFrom(IQueryable query);
} // ISpecification

2 - How are you using this with a generic repository? On my IRepository I have:

T First(ISpecification criteria);

And also:

IQueryable Find(ISpecification criteria);

Which is implemented as follows:

public IQueryable Find(ISpecification criteria) {

return criteria.SatisfyingEntitiesFrom(_session.Context.Set());

} // Find

I was considering using your package but then I was wondering of how are you doing this.

In fact I am using something similar to:
http://huyrua.wordpress.com/2011/04/13/entity-framework-4-poco-repository-and-specification-pattern-upgraded-to-ef-4-1/

Which is available here:
http://code.google.com/p/ef4prs/downloads/list

Thank You,
Miguel