コード例 #1
0
ファイル: HomeController.cs プロジェクト: ittray/LocalDemo
 public ActionResult Index()
 {
     MyAsyncControllerActionInvoker actionInvoker = new MyAsyncControllerActionInvoker();
     Dictionary<ActionDescriptor, ActionResult> actionResults = new Dictionary<ActionDescriptor, ActionResult>();
     ControllerDescriptor controllerDescriptor = actionInvoker.GetControllerDescriptor(this.ControllerContext);
     string[] actions = new string[] { "Foo", "Bar", "Baz", "Qux" };
     Array.ForEach(actions, action =>
     {
         ActionDescriptor actionDescriptor = controllerDescriptor.FindAction(ControllerContext, action);
         ActionResult actionResult = actionInvoker.InvokeActionMethod(this.ControllerContext, actionDescriptor, new Dictionary<string, object>());
         actionResults.Add(actionDescriptor, actionResult);
     });
     return View(actionResults);
 }
コード例 #2
0
        public ActionResult Index()
        {
            MyAsyncControllerActionInvoker actionInvoker = new MyAsyncControllerActionInvoker();
            Dictionary <ActionDescriptor, ActionResult> actionResults = new Dictionary <ActionDescriptor, ActionResult>();
            ControllerDescriptor controllerDescriptor = actionInvoker.GetControllerDescriptor(this.ControllerContext);

            string[] actions = new string[] { "Foo", "Bar", "Baz", "Qux" };
            Array.ForEach(actions, action =>
            {
                ActionDescriptor actionDescriptor = controllerDescriptor.FindAction(ControllerContext, action);
                ActionResult actionResult         = actionInvoker.InvokeActionMethod(this.ControllerContext, actionDescriptor, new Dictionary <string, object>());
                actionResults.Add(actionDescriptor, actionResult);
            });
            return(View(actionResults));
        }