ASP.NET MVC3
DefaultControllerFactory类中的方法
protected internal virtual IController GetControllerInstance(RequestContext requestContext, Type controllerType)
{
if (controllerType == null)
{
throw new HttpException(0x194, string.Format(CultureInfo.CurrentCulture, MvcResources.DefaultControllerFactory_NoControllerFound, new object[] { requestContext.HttpContext.Request.Path }));
}
if (!typeof(IController).IsAssignableFrom(controllerType))
{
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, MvcResources.DefaultControllerFactory_TypeDoesNotSubclassControllerBase, new object[] { controllerType }), "controllerType");
}
return this.ControllerActivator.Create(requestContext, controllerType);
}
其中这个引用是IControllerActivator接口,我想知道它这里具体用的是哪个实现??
this.ControllerActivator.Create(requestContext, controllerType)
找到了