0
当一个方法是直接使用下面的代码,我得到这个错误:没有可用的当前对话。创建一个会话并将其绑定到容器
var fooRepository = ServiceLocator.Current.GetInstance<FooRepository>();
var fooObj = fooRepository.GetFooObj(someText); //get Error
而且堆栈跟踪包含:
在uNhAddIns.SessionEasier.Conversations.ThreadLocalConversationalSessionContext .CurrentSession() 在NHibernate.Impl.SessionFactoryImpl.GetCurrentSession()
错误消息:
没有当前对话可用。创建会话并将其绑定到容器上
一般如何Create a conversation and bind it to the container
?