This project is read-only.

Repository implementation

Mar 26, 2008 at 4:00 PM
Hi, i've started to look att your implementation of repository/unit of work pattern for background motion and it seems great way of doing this. I want to use a similiar thing using the entity framework and have some questions that maybe you can help me answer.

1. Since this was designed a year ago, is there anything you learned during this time of what worked out and if there is something you would have done differently today?
2. Do you see any big problems of using this with entity framework (execept from the fact that model objects has to inherit from EntityObject)
3. Have you considered a way of dealing with multiple repostiories at the same time?
4. How would you suggest handling a specialized repository, for example a CustomerRepository extending the standard Repository methods.

Thanks in advance
/Henrik
Jun 9, 2008 at 6:14 AM
Henrik,
Just want to preface this post with the following statement: "It's a shame there are so many orphaned CodePlex projects".  - end of grip.

Ok, as I am not the original author, I can only make assumptions in my attempt to answer your questions.

Regarding your questions (3,4); I believe the implementation of the Repository pattern is taking advantage of LINQ in the sense that, the repository interface is easily
implemented due to LINQ functionality.  In essence the Repository code in this project is just a light wrapper around LINQ generated classes.  Therefore, it is more of a
generic implementation.  Nothing has to extend the standard Repository methods, as the IRepository is a fully defined interface to provide all necessary functionality to
fulfill the duties of a Repository.

I think what you are seeking is an implementation base more on logic than a generic one that is used in this project.  You might want to take a look at the code here:
http://www.codeplex.com/mvcsamples , it uses more of a logical based approach.

- Good luck.

firefajter wrote:
3. Have you considered a way of dealing with multiple repostiories at the same time?
4. How would you suggest handling a specialized repository, for example a CustomerRepository extending the standard Repository methods.

Thanks in advance
/Henrik