开发者

Repository Pattern-EF4 code generator

开发者 https://www.devze.com 2023-04-04 23:19 出处:网络
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 thos

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.

  1. What are the benefits of using Unit Of Work and Repository pattern together.
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号