Model view controller PerRequestLifetimeManager的注册模块
我想将我的项目中的Unity配置分离到另一个项目中,但我对Unity configuration for MVC中的UnityWebActivator类有一些疑问Model view controller PerRequestLifetimeManager的注册模块,model-view-controller,unity-container,Model View Controller,Unity Container,我想将我的项目中的Unity配置分离到另一个项目中,但我对Unity configuration for MVC中的UnityWebActivator类有一些疑问 在UnityWebActivator类中,它有以下行: // TODO: Uncomment if you want to use PerRequestLifetimeManager // Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.Reg
在UnityWebActivator类中,它有以下行:
// TODO: Uncomment if you want to use PerRequestLifetimeManager
// Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(UnityPerRequestHttpModule));
- 但是如果我不取消注释它们,PerRequestLifetimeManager似乎 还可以。为什么我们必须注册UnityPerRequestHttpModule
- 我找到了在中的Web.config文件中注册模块的方法。是吗 与DynamicModuleHelper.DynamicModuleUtility.RegisterModule类似 方法?如果没有,我可以在Web.config文件中注册该模块吗?如何注册