private Collection <ApiDescription> InitializeApiDescriptions() { Collection <ApiDescription> apiDescriptions = new Collection <ApiDescription>(); IHttpControllerFactory controllerFactory = _config.ServiceResolver.GetHttpControllerFactory(); IDictionary <string, HttpControllerDescriptor> controllerMappings = controllerFactory.GetControllerMapping(); if (controllerMappings != null) { foreach (var route in _config.Routes) { ExploreRouteControllers(controllerMappings, route, apiDescriptions); } // remove ApiDescription that will lead to ambiguous action matching. E.g. a controller with Post() and PostComment(). When the route template is {controller}, it produces POST /controller and POST /controller. apiDescriptions = RemoveInvalidApiDescriptions(apiDescriptions); } return(apiDescriptions); }
IDictionary <string, HttpControllerDescriptor> IHttpControllerFactory.GetControllerMapping() { return(_innerFactory.GetControllerMapping()); }