private void SetLinkedItems(XPathNavigator navigator, ReadingJournal journal, ContentItem item, string name) { var items = new ItemList(); foreach (XPathNavigator itemElement in EnumerateChildren(navigator)) { SetLinkedItem(itemElement.Value, journal, (foundItem) => { items.Add(foundItem); var property = item.GetContentType().GetProperty(name); if (property != null) item[name] = items.ConvertTo(property.PropertyType, name); else item[name] = items; }, itemElement.GetAttribute("versionKey", "")); } }
private void SetLinkedItems(XPathNavigator navigator, ReadingJournal journal, ContentItem item, string name) { var items = new ItemList(); foreach (XPathNavigator itemElement in EnumerateChildren(navigator)) { SetLinkedItem(itemElement.Value, journal, (foundItem) => { items.Add(foundItem); var property = item.GetContentType().GetProperty(name); if (property != null) { item[name] = items.ConvertTo(property.PropertyType, name); } else { item[name] = items; } }, itemElement.GetAttribute("versionKey", "")); } }