views:

240

answers:

1

What is the best place to store the NHibernate session if we only need one?

In the main windows view model?
In the app?
In the DataAccess Class?

+2  A: 

You should read Oren Eini's MSDN article on Building a Desktop To-Do application with NHibernate. He goes into detail about creating and managing the lifetime of an NHibernate session, as well as two-way databinding and propagating entity changes.

I believe he's using some variant of MVP or MVVM in his examples, though he doesn't mention it by name.

dthrasher