Exemplo n.º 1
0
        /// <summary>
        /// create HttpPipelineRouteData instance.
        /// </summary>
        /// <param name="values">route values.</param>
        /// <param name="pipeline">route pipeline.</param>
        internal HttpPipelineRouteData(HttpPipelineRouteData overridedRouteData, HttpPipelineRouter router, IHttpPipelineRouteRule rule, IEnumerable <KeyValuePair <string, string> > values)
        {
            OverridedRouteData = overridedRouteData;
            Router             = router ?? throw new ArgumentNullException(nameof(router));
            RouteRule          = rule ?? throw new ArgumentNullException(nameof(rule));

            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }
            Values = new ReadOnlyDictionary <string, string>(new Dictionary <string, string>(values, StringComparer.OrdinalIgnoreCase));
        }
Exemplo n.º 2
0
        private void CreateRouteData(IHttpPipelineRouteRule rule, HttpRequestMessage request, IEnumerable <KeyValuePair <string, string> > values)
        {
            var routeData = new HttpPipelineRouteData(request.GetRouteData(), this, rule, values);

            request.Properties[RouteDataKey] = routeData;
        }