/// <summary>
        /// Gets the <see cref="HttpActionContext"/> for the currently executing action.
        /// </summary>
        // protected internal HttpActionContext ActionContext { get; internal set; }

        protected override void Initialize(HttpControllerContext controllerContext)
        {
            // ensure that the service is valid and all custom metadata providers
            // have been registered
            _description = DomainControllerDescription.GetDescription(controllerContext.ControllerDescriptor);

            base.Initialize(controllerContext);
        }
        private static IEnumerable <MediaTypeFormatter> GetFormatters(HttpControllerDescriptor descr)
        {
            HttpConfiguration           config   = descr.Configuration;
            DomainControllerDescription dataDesc = DomainControllerDescription.GetDescription(descr);

            List <MediaTypeFormatter> list = new List <MediaTypeFormatter>();

            AddFormattersFromConfig(list, config);
            AddDomainControllerFormatters(list, dataDesc);

            return(list);
        }
Example #3
0
        public override HttpActionDescriptor SelectAction(HttpControllerContext controllerContext)
        {
            // first check to see if this is a call to Submit
            string actionName;

            if (controllerContext.RouteData.Values.TryGetValue(ActionRouteKey, out actionName) && actionName.Equals(SubmitActionValue, StringComparison.Ordinal))
            {
                return(new SubmitActionDescriptor(controllerContext.ControllerDescriptor, controllerContext.Controller.GetType()));
            }

            // next check to see if this is a direct invocation of a CUD action
            DomainControllerDescription description = DomainControllerDescription.GetDescription(controllerContext.ControllerDescriptor);
            UpdateActionDescriptor      action      = description.GetUpdateAction(actionName);

            if (action != null)
            {
                return(new SubmitProxyActionDescriptor(action));
            }

            return(base.SelectAction(controllerContext));
        }