Ejemplo n.º 1
0
        public RouteValueDictionary Match(HttpServerRequest request)
        {
            var urlPath     = request.Url.LocalPath.TrimStart('/');
            var urlParts    = urlPath.Split('/');
            var routeValues = new RouteValueDictionary();

            for (int i = 0; i < _fragments.Length; i++)
            {
                string urlPart = (i < urlParts.Length) ? urlParts[i] : "";
                if (!_fragments[i].Match(urlPart, routeValues))
                {
                    return(null);
                }
            }

            /*if (routeValues.Values.Contains(UrlParameter.Missing))
             *  return null;*/

            return(routeValues);
        }
Ejemplo n.º 2
0
 public HttpServerContext(HttpListenerContext context)
 {
     _innerContext = context;
     Request       = new HttpServerRequest(context.Request);
 }