Breeze.ContextProvider.ContextProvider.JsonToDictionary C# (CSharp) Method

JsonToDictionary() private method

private JsonToDictionary ( dynamic json ) : Object>.Dictionary
json dynamic
return Object>.Dictionary
    private Dictionary<String, Object> JsonToDictionary(dynamic json) {
      if (json == null) return null;
      var jprops = ((System.Collections.IEnumerable)json).Cast<JProperty>();
      var dict = jprops.ToDictionary(jprop => jprop.Name, jprop => {
        var val = jprop.Value as JValue;
        if (val != null) {
          return val.Value;
        } else if (jprop.Value as JArray != null){
          return jprop.Value as JArray;
        } else {
          return jprop.Value as JObject;
        }
      });
      return dict;
    }