public void InvokeAction(ControllerContext controllerContext, string actionName) { MethodInfo methodInfo = controllerContext.Controller.GetType().GetMethods().First(m => string.Compare(actionName, m.Name, true) == 0); List<object> parameters = new List<object>(); foreach (ParameterInfo parameter in methodInfo.GetParameters()) { parameters.Add(this.ModelBinder.BindModel(controllerContext, parameter.Name, parameter.ParameterType)); } ActionExecutor executor = new ActionExecutor(methodInfo); ActionResult actionResult = (ActionResult)executor.Execute(controllerContext.Controller, parameters.ToArray()); actionResult.ExecuteResult(controllerContext); }
public abstract void ExecuteResult(ControllerContext context);
public override void ExecuteResult(ControllerContext context) { context.RequestContext.HttpContext.Response.Write(this.RawData); }
public override void ExecuteResult(ControllerContext context) { this.Callback(context.RequestContext.HttpContext.Response.Output); }