I've been using EF4 as a ORM in many projects since its earlier version, without any pattern such as Unit Of Work
and IRepository
.But now based on many articles reading everyday I decided to use those patterns side by side.
Now I have two questions, maybe first one is frequently asked, but I would like to hear more from all experts.
- What are the benefits of using Unit Of Work and Repository pattern together.
- I would like to know Is there any code generator to gene开发者_JAVA技巧rate nice and clean code for this patterns ?
Thanks in advance.
What are the benefits of using Unit Of Work and Repository pattern together.
Check these answers:
- Are Unit of Work and Repository pattern redundant in EF code first
- Generic repository in EF 4.1 what is the point
- The repository itself is not usually tested?
I would like to know Is there any code generator to generate nice and clean code for this patterns ?
According to previous linked answers do you still think that autogeneration makes sense? Generic repository is just single class and alone it is in most scenarios redundant. It is only useful as a base class for specific repositories which must be developed manually.
精彩评论