存储库模式-EF4代码生成器
自早期版本以来,我一直在许多项目中使用 EF4 作为 ORM,没有任何模式,例如 Unit Of Work
和 IRepository
。但现在基于每天阅读的许多文章,我决定并排使用这些模式。
现在我有两个问题,也许第一个问题是经常被问到的,但我想听听各位专家的更多意见。
- 一起使用工作单元和存储库模式有什么好处?
- 我想知道是否有任何代码生成器可以为这种模式生成漂亮且干净的代码?
提前致谢。
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 generate nice and clean code for this patterns ?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查这些答案:
根据之前的链接答案,您仍然认为自动生成有意义吗?通用存储库只是单个类,并且在大多数情况下它是多余的。它仅用作必须手动开发的特定存储库的基类。
Check these answers:
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.