Rebel.Cms.Web.ValueProviderExtensions.ToValueProvider C# (CSharp) Method

ToValueProvider() public static method

Converts a dictionary to an IValueProvider
public static ToValueProvider ( string>.this dictionary ) : IValueProvider
dictionary string>.this
return IValueProvider
        public static IValueProvider ToValueProvider(this IDictionary<string, string> dictionary)
        {
            var collection = new NameValueCollection();
            foreach (var f in dictionary)
            {
                collection.Add(f.Key, f.Value);
            }
            var valProvider = new NameValueCollectionValueProvider(collection, CultureInfo.InvariantCulture);
            return valProvider;  
        }
    }
ValueProviderExtensions