Orchard NHibernate 会话工厂初始化
我目前正在查看 Orchard 源代码,但找不到 NHibernate 会话工厂在 AutoFac 中注册的位置。有人可以帮忙吗?
谢谢
I'm currently looking at the Orchard source code and can't find where the NHibernate Session Factory been registered into the AutoFac. Anybody can help with that?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Orchard.Framework\Data\SessionFactoryHolder.cs 可能是一个很好的起点。我相信这就是构建 NHib 配置并初始化会话的地方。
Orchard.Framework\Data\SessionFactoryHolder.cs is probably a good place to start. I believe that's where the NHib configuration is built and the session is initialized.
正确答案是
ShellContainerFactory
。在
ShellContainerFactory
中,它将扫描所有从IDependency
继承的类并注册它们。SessionFactoryHolder
继承自IDependency
,因此它将自动注册。The correct answer is
ShellContainerFactory
.In
ShellContainerFactory
, it will scan all fromIDependency
inherited classes and register them. TheSessionFactoryHolder
is inherited fromIDependency
so it will be registered automatically.