private bool TryGetFieldFromName(string name, out object result) { if (!_dictionary.TryGetValue(name, out result)) { result = null; } var dictionary = result as IDictionary <string, object>; if (dictionary != null) { result = new DynamicJsonObject(dictionary); } var arrayList = result as ArrayList; if (arrayList != null) { if (arrayList.Count > 0 && arrayList[0] is IDictionary <string, object> ) { result = new List <object>(arrayList.Cast <IDictionary <string, object> >().Select(x => new DynamicJsonObject(x))); } else { result = new List <object>(arrayList.Cast <object>()); } } return(true); }
private bool TryGetFieldFromName(string name, out object result) { if (!_dictionary.TryGetValue(name, out result)) { result = null; } var dictionary = result as IDictionary<string, object>; if (dictionary != null) { result = new DynamicJsonObject(dictionary); } var arrayList = result as ArrayList; if (arrayList != null) { if (arrayList.Count > 0 && arrayList[0] is IDictionary<string, object>) result = new List<object>(arrayList.Cast<IDictionary<string, object>>().Select(x => new DynamicJsonObject(x))); else result = new List<object>(arrayList.Cast<object>()); } return true; }