Exemple #1
0
        public ControllerActionInvoker(Type controllerType)
        {
            Guard.ArgumentNotNull(controllerType, "controllerType");
            _controllerType = controllerType;

            lock (_lock)
            {
                if (!_controllerDescriptorsCache.TryGetValue(controllerType, out _controllerDescriptor))
                {
                    _controllerDescriptor = new ReflectedControllerDescriptor(controllerType);
                    _controllerDescriptorsCache.Add(controllerType, _controllerDescriptor);
                }
            }
        }
Exemple #2
0
        internal ReflectedActionDescriptor(MethodInfo methodInfo, string actionName, ControllerDescriptor controllerDescriptor,
                                           bool validateMethod)
        {
            Guard.ArgumentNotNull(methodInfo, "methodInfo");
            Guard.ArgumentNotNullOrWhiteSpace(actionName, "actionName");
            Guard.ArgumentNotNull(controllerDescriptor, "controllerDescriptor");

            // check
            if (validateMethod)
            {
                VerifyActionMethodIsCallable(methodInfo);
            }

            _methodInfo           = methodInfo;
            _actionName           = actionName;
            _controllerDescriptor = controllerDescriptor;
        }
Exemple #3
0
 public ReflectedActionDescriptor(MethodInfo methodInfo, string actionName, ControllerDescriptor controllerDescriptor)
     : this(methodInfo, actionName, controllerDescriptor, true)
 {
 }