Exemple #1
0
        public override IValueProvider GetValueProvider(HttpActionContext actionContext)
        {
            if (actionContext == null)
            {
                throw Error.ArgumentNull("actionContext");
            }

            // Only parse the query string once-per request.

            FixedQueryStringValueProvider provider;
            IDictionary <string, object>  storage = actionContext.Request.Properties;

            if (!storage.TryGetValue(RequestLocalStorageKey, out provider))
            {
                provider = new FixedQueryStringValueProvider(actionContext, CultureInfo.InvariantCulture);
                storage[RequestLocalStorageKey] = provider;
            }

            return(provider);
        }
        public override IValueProvider GetValueProvider(HttpActionContext actionContext)
        {

            if (actionContext == null)
            {
                throw Error.ArgumentNull("actionContext");
            }

            // Only parse the query string once-per request. 

            FixedQueryStringValueProvider provider;
            IDictionary<string, object> storage = actionContext.Request.Properties;

            if (!storage.TryGetValue(RequestLocalStorageKey, out provider))
            {
                provider = new FixedQueryStringValueProvider(actionContext, CultureInfo.InvariantCulture);
                storage[RequestLocalStorageKey] = provider;
            }

            return provider;
        }