Repository with Linq

6 views
Skip to first unread message

Claudio Maccari

unread,
Oct 8, 2009, 5:58:42 AM10/8/09
to sharp-arc...@googlegroups.com
Hi everybody,

I've just added some Linq features to Repository class.
If anyone is interested the code can be found in my fork http://github.com/scott4dev/Sharp-Architecture/

I've also send a pull request to codai.
This my first  pull so please forgive me if something is wrong.
Bye
makka

--
Claudio Maccari
--------------------------------
http://testdrivendevelopment.wordpress.com/

Simone Busoli

unread,
Oct 8, 2009, 8:22:31 AM10/8/09
to sharp-arc...@googlegroups.com
I think features are supposed to be discussed here first, before
evaluating them for integration in the master repository.

2009/10/8, Claudio Maccari <claudio...@gmail.com>:
--
Inviato dal mio dispositivo mobile

Claudio Maccari

unread,
Oct 8, 2009, 8:30:46 AM10/8/09
to sharp-arc...@googlegroups.com
Ok, no problem.

Following your suggestion please discharge my pull request.
If you want you can consider the code in my fork as proposal for a Repository with Linq features.
Let's me kwon what do you think about ?

makka

2009/10/8 Simone Busoli <simone...@gmail.com>

Scott Belchak

unread,
Oct 8, 2009, 9:49:02 AM10/8/09
to sharp-arc...@googlegroups.com
I like it!  I'll take a better look soon.

Bobby Johnson

unread,
Oct 8, 2009, 10:58:23 AM10/8/09
to sharp-arc...@googlegroups.com
If we are going to expose linq from the repository, I would prefer we did it by using the specification pattern. So instead of allowing the query to happen outside of the repository, the caller hands the repo a specification that it then executes and returns a set. Here is a great blog post discussing exactly what I am talking about.

http://www.codeinsanity.com/2008/08/implementing-repository-and.html
--
"The explanation requiring the fewest assumptions is most likely to be correct."

- Occam’s Razor
http://en.wikipedia.org/wiki/Occam's_Razor

Claudio Maccari

unread,
Oct 8, 2009, 11:12:39 AM10/8/09
to sharp-arc...@googlegroups.com
Hi Bobby,

in the production code I have also:

IQueryable<T> FindAll(ISpecification<T> specification);
T FindOne(ISpecification<T> specification);

methods.
Actualy the production code is slightly different so I need some refactor before posting it to github.com
I'll put this code in my fork very soon.

Bye
makka

2009/10/8 Bobby Johnson <bobby....@gmail.com>

Bobby Johnson

unread,
Oct 8, 2009, 12:30:21 PM10/8/09
to sharp-arc...@googlegroups.com
Nice!
Reply all
Reply to author
Forward
0 new messages