存储库模式-EF4代码生成器

发布于 2024-12-04 09:53:44 字数 309 浏览 3 评论 0原文

自早期版本以来,我一直在许多项目中使用 EF4 作为 ORM,没有任何模式,例如 Unit Of WorkIRepository。但现在基于每天阅读的许多文章,我决定并排使用这些模式。

现在我有两个问题,也许第一个问题是经常被问到的,但我想听听各位专家的更多意见。

  1. 一起使用工作单元和存储库模式有什么好处?
  2. 我想知道是否有任何代码生成器可以为这种模式生成漂亮且干净的代码?

提前致谢。

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 generate nice and clean code for this patterns ?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

素衣风尘叹 2024-12-11 09:53:44

一起使用工作单元和存储库模式有什么好处。

检查这些答案:

我想知道是否有任何代码生成器可以为这种模式生成漂亮且干净的代码?

根据之前的链接答案,您仍然认为自动生成有意义吗?通用存储库只是单个类,并且在大多数情况下它是多余的。它仅用作必须手动开发的特定存储库的基类。

What are the benefits of using Unit Of Work and Repository pattern together.

Check these answers:

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文