I\'ve recently moved from using an ISession directly to a wrapped ISession, Unit-of-Work type pattern.
I used to test this using SQL Lite (in-memory). I\'ve got a s
Try this:
try
{
if (NHibernate.Context.CurrentSessionContext.HasBind(sessionFactory))
{
session = sessionFactory.GetCurrentSession();
}
else
{
session = sessionFactory.OpenSession(this.dateTimeInterceptor);
NHibernate.Context.CurrentSessionContext.Bind(session);
}
}
catch (Exception ex)
{
Debug.Write(ex.Message);
throw;
}