What to take care when using NHibernate with WCF?

I just start with both NHibernate and WCF. I would like to use NHibernate as my ORM in the class library where my repositories are stored. I also need to use WCF to expose my business logic, as well as my repositories for the rest of the company.

Is there any good documentation on how to complete this task? Are there pitfalls to take care in advance? Any recommended reads / books?

I am looking for information on how best to integrate NHibernate into WCF. I am using HttpModule, must connect something in global.asax of my service level (using IIS hosting, so that I start a web application project to start with). Do I go for a session for a request or something else?

+5
source share
1 answer

I know one.

Use individual classes as a DataContract instead of using the mapped NHibernate classes.

It can be a DTO object between the WCF client and the server. You can use AutoMapper to map DTO and Entity classes.

Look at the problems I encountered while trying to improve the performance of a data service built using NHibernate and WCF.

NHibernate Data Access Level Performance Improvement

+3
source

All Articles