Exemplo n.º 1
0
        private void InvokeErrorAction(HttpContext httpContext, Exception exception)
        {
            var routeData = new RouteData();

            routeData.Values["controller"] = "home";
            routeData.Values["action"]     = "error";
            routeData.Values["id"]         = "this is a test";
            using (var controller = new Controllers.HomeController())
            {
                var requestContext = new RequestContext(new HttpContextWrapper(Context), routeData);
                ((IController)controller).Execute(requestContext);
            }
        }