Creating a controller type with a controller created by VS is actually inheriting the abstract class System.Web.Mvc.Controller, which is a subclass of Controllerbase, Abstract class System.Web.Mvc.Controller In addition to inheriting controllerbase, he also shows implementations of IController and Iasynccontroller interfaces and representing ASP. The four filters Authorizationfilter,actionfilter,resultfilter,exceptionfilter four interfaces.
Mvcroutehandler maintains this Controllerfactory object, which can be specified in the constructor again if no display is specified by the current controllerbulider of the Getcontrollerfactory () Method gets
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) }}
Controller activation (2)