public HttpRoute GetRouteData(HttpRequestMessage request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            HttpRoute matchedRoute = routes.FirstOrDefault(r => r.IsMatch(request.RequestUri, request.Method));

            return(matchedRoute);
        }
 public void Add(HttpRoute route)
 {
     if (route == null)
     {
         throw new ArgumentNullException(nameof(route));
     }
     if (route.UriTemplate == null)
     {
         throw new ArgumentException();
     }
     routes.Add(route);
 }
 public void Add(HttpRoute route)
 {
     if (route == null)
     {
         throw new ArgumentNullException(nameof(route));
     }
     if (route.UriTemplate == null)
     {
         throw new ArgumentException("Uri template must be specified.");
     }
     routes.Add(route);
 }
Ejemplo n.º 4
0
        /*
         * An http route collection stores all the routes for application. You can
         * add additional field or private method but you should not modify the
         * public interfaces.
         */

        public void Add(HttpRoute route)
        {
            throw new NotImplementedException();
        }