1
protected virtual IActionResult InvokeHttp404()
{
IController errorController = EngineContext.Current.Resolve<CommonController>();
var routeData = new RouteData();
routeData.Values.Add("controller", "Common");
routeData.Values.Add("action", "PageNotFound");
errorController.Execute(new RequestContext(HttpContext, routeData));
return new EmptyResult();
}
在新的Microsoft.AspNet.Mvc中,無法找到IController,並且Execute不是IController的一部分。我在哪裏可以找到MVC 6的IController?
太棒了!謝謝,斯塔福德! – nruim83