private static void AddToBackingStore(LargeJsonValueProviderFactory.EntryLimitedDictionary backingStore, string prefix, object value)
    {
        IDictionary <string, object> dictionary = value as IDictionary <string, object>;

        if (dictionary != null)
        {
            foreach (KeyValuePair <string, object> keyValuePair in (IEnumerable <KeyValuePair <string, object> >)dictionary)
            {
                LargeJsonValueProviderFactory.AddToBackingStore(backingStore, LargeJsonValueProviderFactory.MakePropertyKey(prefix, keyValuePair.Key), keyValuePair.Value);
            }
        }
        else
        {
            IList list = value as IList;
            if (list != null)
            {
                for (int index = 0; index < list.Count; ++index)
                {
                    LargeJsonValueProviderFactory.AddToBackingStore(backingStore, LargeJsonValueProviderFactory.MakeArrayKey(prefix, index), list[index]);
                }
            }
            else
            {
                backingStore.Add(prefix, value);
            }
        }
    }
    /// <summary>Returns a JSON value-provider object for the specified controller context.</summary>
    /// <returns>A JSON value-provider object for the specified controller context.</returns>
    /// <param name="controllerContext">The controller context.</param>
    public override IValueProvider GetValueProvider(ControllerContext controllerContext)
    {
        if (controllerContext == null)
        {
            throw new ArgumentNullException("controllerContext");
        }
        object deserializedObject = LargeJsonValueProviderFactory.GetDeserializedObject(controllerContext);

        if (deserializedObject == null)
        {
            return((IValueProvider)null);
        }
        Dictionary <string, object> dictionary = new Dictionary <string, object>((IEqualityComparer <string>)StringComparer.OrdinalIgnoreCase);

        LargeJsonValueProviderFactory.AddToBackingStore(new LargeJsonValueProviderFactory.EntryLimitedDictionary((IDictionary <string, object>)dictionary), string.Empty, deserializedObject);
        return((IValueProvider) new DictionaryValueProvider <object>((IDictionary <string, object>)dictionary, CultureInfo.CurrentCulture));
    }