nHibernate session - Using repository pattern in Web, windows, wcf etc...

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-04-06T22:36:12Z Indexed on 2010/04/06 22:43 UTC
Read the original article Hit count: 328

I recently posted a question which was answered by Bryan Watts, regarding generic repository for nHibernate.

I'm trying to design my data access to allow various facets - from ASP.net, WCF and Windows Forms / Windows services. I'm a bit confused re: session management etc..

How would I handle this?

I've been checking out code such as: http://membranecms.googlecode.com/svn/

and questions such as: http://stackoverflow.com/questions/1207833/nhibernate-linq-session-management

But what do i do if i don't just do things in a web based environment..?

Do i need to create different repositories for each client? Or do i pass in the ISession into the (for example) UserRepository constructor..?

... as a side note I'm using nHibernate.Linq Also using fluent nHibernate to config my mapping

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about repository-pattern