views:

33

answers:

1

I am just a simple beginner with both NHibernate and WCF. I would like to use NHibernate as my ORM in the class library where my repositories are. I also need to use WCF to expose my business logic, and behind that my repositories, to the rest of the company.

Is there some good documentation on how to accomplish this task? Are there pitfalls to take care off in advance? Any recommended reading/books?

I am looking for information on how to best integrate NHibernate in WCF. Do I use a HttpModule, have to wire up something in the global.asax of my service layer (using IIS hosting so I went for a web application project to start from). Do I go for Session per request or something else?

+2  A: 

I know one.

Use separate classes as your DataContract instead of using the NHibernate mapped classes.

This can act as a DTO object between WCF Client and Server. You can use AutoMapper to map the DTO and Entity classes.

Look into the issues I came across while trying to improve the performance of a Data Service built using NHibernate and WCF.

http://stackoverflow.com/questions/2662428/improving-the-performance-of-an-nhibernate-data-access-layer

Amitabh
Yes, yes, yes :)
JulianM
I will take a look at it. Thank you for the contribution.
Nyla Pareska