public HttpActionDescriptor SelectAction(HttpControllerContext controllerContext)
            {
                // Performance-sensitive
                CandidateAction[] candidates = GetInitialCandidateList(controllerContext);

                // Make sure the action parameter matches the route and query parameters. Overload resolution logic is applied when needed.
                List <CandidateAction> actionsFoundByParams   = FindActionUsingRouteAndQueryParameters(controllerContext, candidates);
                List <CandidateAction> maximumOrderCandidates = RunOrderFilter(actionsFoundByParams);
                List <CandidateAction> selectedCandidates     = RunPrecedenceFilter(maximumOrderCandidates);

                candidates           = null;
                actionsFoundByParams = null;

                switch (selectedCandidates.Count)
                {
                case 0:
                    throw new HttpResponseException(CreateSelectionError(controllerContext));

                case 1:
                    controllerContext.ElevateRouteData(selectedCandidates[0].ActionDescriptor);
                    return(selectedCandidates[0].ActionDescriptor);

                default:

                    // Throws exception because multiple actions match the request
                    string ambiguityList = CreateAmbiguousMatchList(selectedCandidates);
                    throw Error.InvalidOperation(SRResources.ApiControllerActionSelector_AmbiguousMatch, ambiguityList);
                }
            }