|
4
|
| mxmissile · 技术社区 · 17 年前 |
|
|
1
1
您应该使用工厂方法注册ISession。 另一个选择(并非总是最好的,但易于使用)是: 实现ISession和ISessionFactory接口(SessionProxy和SessionFactoryProxy)。
通过这种方式,您可以只注册ISession(由SessionAggregator实现)和ISessionFactory(SessionFactoryAggregator),任何DI框架都可以轻松地解析ISession。
我已经将这些实现添加到我的Commons assembly中,所以我不应该每次都重新实现它。 编辑: 现在,要在web应用程序中使用ISession:
|
|
|
2
0
This 问题及;答案可能会帮助你。 一种方法-从中窃取nhibernate会话管理 "S#arp Architecture" |
|
|
Andrus · 如何在Linux中阅读期刊 1 年前 |
|
|
Miranda · 读取xml文件时路径错误中有非法字符 1 年前 |
|
|
Primdonm · 如何将自定义列表中的字符串值格式化为货币格式? 2 年前 |
|
|
Kiryl · Sitecore中自己的控制器 2 年前 |
|
|
Farid · 如何从数据库中填充Resource.resx文件值? 2 年前 |