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; }
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); }