public IEnumerable <IFhirReader> GetArrayElements() { var array = _current as JArray; if (array == null) { throw Error.Format("Need to be at an array to list elements", JsonDomFhirReader.GetLineInfo(_current)); } foreach (var element in array) { yield return(new JsonDomFhirReader(element)); } }
private static IList <BundleEntry> loadEntries(JArray entries, Bundle parent) { var result = new List <BundleEntry>(); foreach (var entry in entries) { if (entry.Type != JTokenType.Object) { throw Error.Format("Expected a complex object when reading an entry", JsonDomFhirReader.GetLineInfo(entries)); } var loaded = loadEntry((JObject)entry); if (entry != null) { result.Add(loaded); } } return(result); }