public IActionResult GetRoutes() { var serviceName = actionDescriptorCollectionProvider.ActionDescriptors.Items[0].DisplayName.Split(".")[0]; var routes = actionDescriptorCollectionProvider.ActionDescriptors.Items.Select(a => { return(new { Method = RouteHelper.GetCorrectHttpMethod(a.EndpointMetadata[0].ToString()), Route = a.AttributeRouteInfo.Template, }); }); return(Ok(routes)); }
public ServiceRoute DiscoverRoutes() { var serviceName = actionDescriptor.ActionDescriptors.Items[0].DisplayName.Split(".")[0]; var routes = actionDescriptor.ActionDescriptors.Items.Select(a => { return(new RouteModel { Method = RouteHelper.GetCorrectHttpMethod(a.EndpointMetadata[0].ToString()), Route = a.AttributeRouteInfo.Template, }); }); return(new ServiceRoute { ServiceName = serviceName, RouteModels = routes }); }