public IValueProvider GetValueProvider([NotNull] ValueProviderFactoryContext context)
 {
     // Process the query collection once-per request. 
     var storage = context.HttpContext.Items;
     object value;
     IValueProvider provider;
     if (!storage.TryGetValue(_cacheKey, out value))
     {
         var queryCollection = context.HttpContext.Request.Query;
         provider = new ReadableStringCollectionValueProvider(queryCollection, CultureInfo.InvariantCulture);
         storage[_cacheKey] = provider;
     }
     else
     {
         provider = (ReadableStringCollectionValueProvider)value;
     }
     return provider;
 }
Esempio n. 2
0
        public IValueProvider GetValueProvider([NotNull] ValueProviderFactoryContext context)
        {
            // Process the query collection once-per request.
            var            storage = context.HttpContext.Items;
            object         value;
            IValueProvider provider;

            if (!storage.TryGetValue(_cacheKey, out value))
            {
                var queryCollection = context.HttpContext.Request.Query;
                provider           = new ReadableStringCollectionValueProvider(queryCollection, CultureInfo.InvariantCulture);
                storage[_cacheKey] = provider;
            }
            else
            {
                provider = (ReadableStringCollectionValueProvider)value;
            }
            return(provider);
        }