private ContentItemFields GetContentItemFields(ContentItemData entry, ContentType contentType) { var fields = new ContentItemFields(); contentType.Fields .ToList() .ForEach(x => fields.Add(x.Id, AdaptField(entry, x))); return(fields); }
private dynamic GetFieldValue(ContentItemData currentItem, ContentItemFields entry, Field field) { return(_fieldAdapters.ResolveAdapter(field.Type).WriteField(currentItem.GetField(field.Id), field, entry.GetField(field.Id))); }
public ContentItemData TransformContentItemData(ContentItemData originalItem, ContentItemFields newValues, ContentType contentType) { contentType.Fields .ToList() .ForEach(x => SetField(originalItem, x.Id, GetFieldValue(originalItem, newValues, x))); return(originalItem); }