[英]What is the best businessmodel when using NHibernate to access the database?
I'm starting to use NHiberante as a dataaccess tier. 我开始使用NHiberante作为数据访问层。
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. 这意味着,我的域模型(实际上不是一个层),我的asp.net应用程序层,我的存储库层(最终使用了我的数据访问层)。
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. 但是根据我现在(在NHibernate上)学到的知识,我知道ISession中完成了很多逻辑,所以我想知道NHibernate是否可以在存储库层中使用。
Or perhaps there are even better ways to use NHibernate. 也许还有使用NHibernate的更好方法。 Does anyone know where I could find a propriate example of how to use NHibernate in an webapplication? 有谁知道我在哪里可以找到如何在Web应用程序中使用NHibernate的示例?
Cheers, M. 干杯,M。
S#arp体系结构是使用NHibernate的完整示例或Web体系结构。
You can use Nhibernate with Linq extension. 您可以将Nhibernate与Linq扩展一起使用。 By using Linq, you can write your logic in your service layer and repository only get items IQuerable. 通过使用Linq,您可以在服务层中编写逻辑,并且存储库仅获取IQuerable项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.