Ejemplo n.º 1
0
 /// <summary>
 /// Finds the action for the controller, if not it is inferred.
 /// </summary>
 /// <param name="controllerContext"></param>
 /// <param name="controllerDescriptor"></param>
 /// <param name="actionName"></param>
 /// <returns></returns>
 protected override ActionDescriptor FindAction(ControllerContext controllerContext,
     ControllerDescriptor controllerDescriptor, string actionName)
 {
     var foundAction = base.FindAction(controllerContext, controllerDescriptor, actionName);
     if (foundAction == null) {
         InferredAction inferredAction = GetInferredAction(controllerDescriptor, actionName);
         foundAction = new InferredActionDescriptor(actionName, controllerDescriptor, inferredAction);
     }
     return foundAction;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Finds the action for the controller, if not it is inferred.
        /// </summary>
        /// <param name="controllerContext"></param>
        /// <param name="controllerDescriptor"></param>
        /// <param name="actionName"></param>
        /// <returns></returns>
        protected override ActionDescriptor FindAction(ControllerContext controllerContext,
                                                       ControllerDescriptor controllerDescriptor, string actionName)
        {
            var foundAction = base.FindAction(controllerContext, controllerDescriptor, actionName);

            if (foundAction == null)
            {
                InferredAction inferredAction = GetInferredAction(controllerDescriptor, actionName);
                foundAction = new InferredActionDescriptor(actionName, controllerDescriptor, inferredAction);
            }
            return(foundAction);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Finds the action for the controller, if not it is inferred.
        /// </summary>
        /// <param name="controllerContext"></param>
        /// <param name="controllerDescriptor"></param>
        /// <param name="actionName"></param>
        /// <returns></returns>
        protected override ActionDescriptor FindAction(ControllerContext controllerContext,
            ControllerDescriptor controllerDescriptor, string actionName)
        {
            ActionDescriptor foundAction;

            try {
                // Find the base action
                foundAction = base.FindAction(controllerContext, controllerDescriptor, actionName);
            } catch {
                //HACK: Had to add this piece to support ASP.NET MVC on Mono
                foundAction = null;
            }

            if (foundAction == null) {
                foundAction = new InferredActionDescriptor(actionName, controllerDescriptor);
            }

            return foundAction;
        }