Cie*_*iel 12 ninject ninject-extensions asp.net-mvc-3
我最近尝试了Ninject与Ninject.Web.Mvc扩展,我已经发现了一些奇特的和,而不是突破,令人目不暇接.
在NinjectHttpApplication抽象类中,有一个构造函数定义如下..
/// <summary>
/// Initializes a new instance of the <see cref="NinjectHttpApplication"/> class.
/// </summary>
protected NinjectHttpApplication()
{
this.onePerRequestModule = new OnePerRequestModule();
this.onePerRequestModule.Init(this);
}
Run Code Online (Sandbox Code Playgroud)
我在这里放置了一个调试器断点,这会被调用几次.我找不到任何真实的文档.在实现代码中,有这条线引起了我的注意.
if (kernel.Settings.Get("ReleaseScopeAtRequestEnd", true))
{
OnePerRequestModule.StartManaging(kernel);
}
Run Code Online (Sandbox Code Playgroud)
我的问题如下......
OnePerRequestModuleStartManaging如果构造函数被多次调用,那么此方法的目的是什么?| 归档时间: |
|
| 查看次数: |
2981 次 |
| 最近记录: |