Ninject setup for general repository using Nhibernate

和自甴很熟 提交于 2019-12-04 16:05:02

The ISession object is not managed by ninject but by NH in your sample. Therefore your IUnitOfWork can live longer than the session managed by NH. Either manage everything with Ninject or use the appropriate session context. The problem root cause is in BeginUnitOfWork where you newing up your unit of work and use SessionFactory.OpenSession().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!