使用NHibernate访问数据库时最好的商业模式是什么?

发布于 2024-09-02 14:28:25 字数 306 浏览 2 评论 0原文

我开始使用 NHiberante 作为数据访问层。
我习惯于使用存储库模型作为业务模型。

这意味着,我的域模型(不是真正的层)、我的 asp.net 应用程序层、我的存储库层(最终使用我的数据访问层)。

但根据我现在(在 NHibernate 上)学到的知识,我知道许多逻辑是在 ISession 中完成的,所以我想知道 NHibernate 是否可以在存储库层中使用。

或者也许有更好的方法来使用 NHibernate。有谁知道我在哪里可以找到如何在 Web 应用程序中使用 NHibernate 的适当示例?

干杯, M。

I'm starting to use NHiberante as a dataaccess tier.
I'm used to work with the repository model as a business model.

This means, my domain model (not really a tier), my asp.net application tier, my repository tier which finally uses my dataaccess tier.

But with what I've learned by now (on NHibernate) I know that many logic is done within an ISession so I was wondering if NHibernate could be used within the repository tier.

Or perhaps there are even better ways to use NHibernate. Does anyone know where I could find a propriate example of how to use NHibernate in an webapplication?

Cheers,
M.

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

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

发布评论

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

评论(2

烦人精 2024-09-09 14:28:25

S#arp Architecture 是一个完整的示例或使用 NHibernate 的 Web 架构。

S#arp Architecture is a complete example or a Web architecture using NHibernate.

随遇而安 2024-09-09 14:28:25

您可以使用带有 Linq 扩展的 Nhibernate。通过使用 Linq,您可以在服务层中编写逻辑,并且存储库仅获取 IQuerable 项。

You can use Nhibernate with Linq extension. By using Linq, you can write your logic in your service layer and repository only get items IQuerable.

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