Manos.Mvc.ActionHandler.InvokeControllerInternal C# (CSharp) Method

InvokeControllerInternal() private method

private InvokeControllerInternal ( IManosContext ctx ) : void
ctx IManosContext
return void
        void InvokeControllerInternal(IManosContext ctx)
        {
            try
            {
                // Create a context
                var Context = new ControllerContext()
                {
                    Application = owner.Service.Application,
                    CurrentAction = methodInfo,
                    ManosContext = ctx,
                };

                // Create the controller
                Context.Controller = owner.Service.CreateControllerInstance(Context, owner.ControllerType);
                Context.Controller.Context = Context;

                // Get parameters from the incoming data
                object[] data;
                var pi = methodInfo.GetParameters();
                if (pi.Length > 0)
                {
                    ParameterizedActionTarget.TryGetDataForParamList(methodInfo.GetParameters(), null, ctx, out data);
                }
                else
                {
                    data = null;
                }

                // Invoke the controller
                var result = actionDelegate(Context.Controller, data);

                // Process the result
                Context.ProcessResult(result);
            }
            catch (Exception x)
            {
                ExceptionRenderer.RenderException(ctx, x, true);
            }
        }