标签:
通过VS 的Controller 创建想到创建的Controller 类型 实际上继承了抽象类System.Web.Mvc.Controller,他是ControllerBase的子类,抽象类System.Web.Mvc.Controller 除了继承ControllerBase之外,他还显示的实现了IController 和IAsyncController接口以及代表ASP.NET MVC 四大筛选器AuthorizationFilter,ActionFilter,ResultFilter,ExceptionFilter 的四个接口。
MvcRouteHandler维护这一个ControllerFactory 对象,该对象可以再构造函数中指定,如果没有显示的指定则通过当前的ControllerBulider的GetControllerFactory()方法获取
public class MvcRouteHandler:IRouteHandler { private IControllerFactory _controllerFactory; public MvcRouteHandler():this(ControllerBulider.Current.GetControllerFactory()) public MvcRouteHandler(IControllerFactory controllerFactory) { _controllerFactory=controllerFactory } IhttpHandler IRouteHandler.GetHttpHandler(RequestContext requestContext) { ------ return new MvcHandler(requestContext) } }
标签:
原文地址:http://www.cnblogs.com/871735097-/p/4609816.html