/// <summary> /// Determine whether this route is a match for the incoming request by looking up the <see cref="!:IRouteData" /> for the route. /// </summary> /// <returns> /// The <see cref="!:RouteData" /> for a route if matches; otherwise null. /// </returns> /// <param name="virtualPathRoot">The virtual path root.</param><param name="request">The request.</param> public IHttpRouteData GetRouteData(string virtualPathRoot, HttpRequestMessage request) { var route = new SubRoute(request.RequestUri.LocalPath); while (!route.AtEnd()) { var key = Tuple.Create(request.Method.Method, route); IHttpRoute[] data; if (routDataCache.TryGetValue(key, out data)) { var httpRouteDatas = data.Select(x => x.GetRouteData(virtualPathRoot, request)).Where(x => x != null).ToArray(); return(new RavenRouteCollectionRouteData(this, httpRouteDatas)); } route.NextSubRoute(); } return(LocateRouteData(virtualPathRoot, request)); }