public IController CreateController(RequestContext requestContext,string controllerName) { string typeName = controllerName + "Controller"; Type controllerType = controllerTypes.FirstOrDefault(c => string.Compare(typeName, c.Name, true) == 0); if (null == controllerType) { return null; } return (IController)Activator.CreateInstance(controllerType); }
protected virtual void OnPostResolveRequestCache(object sender, EventArgs e) { HttpContextWrapper httpContext = new HttpContextWrapper(HttpContext.Current); RouteData routeData = RouteTable.Routes.GetRouteData(httpContext); if (null == routeData) { return; } RequestContext requestContext = new RequestContext { RouteData = routeData, HttpContext = httpContext }; IHttpHandler handler = routeData.RouteHandler.GetHttpHandler(requestContext); httpContext.RemapHandler(handler); }
public MvcHandler(RequestContext requestContext) { this.RequestContext = requestContext; }
public IHttpHandler GetHttpHandler(RequestContext requestContext) { return new MvcHandler(requestContext); }