Exemplo n.º 1
0
        public void Execute(RequestContext context)
        {
            ControllerContext controllerContext = new ControllerContext();
            controllerContext.RequestContext = context;
            controllerContext.Controller = this;

            string actionName = context.RouteData.ActionName;
            this.ActionInvoker.InvokeAction(controllerContext, actionName);
        }
Exemplo n.º 2
0
        public void InvokeAction(ControllerContext context, string actionName)
        {
            MethodInfo method = GetFirstMemberInfo(context.Controller.GetType().GetMethods(), actionName);
            List<object> parameters = new List<object>();
            foreach (ParameterInfo parameter in method.GetParameters())
            {
                parameters.Add(this.ModelBinder.BindModel(context, parameter.Name, parameter.ParameterType));
            }

            ActionResult actionResult = method.Invoke(context.Controller, parameters.ToArray()) as ActionResult;
            actionResult.ExecuteResult(context);
        }
Exemplo n.º 3
0
 public abstract void ExecuteResult(ControllerContext context);
Exemplo n.º 4
0
 public override void ExecuteResult(ControllerContext context)
 {
     context.RequestContext.HttpContext.Response.Write(this.RawData);
 }