protected static ContentData CheckForExistingItem(DataRow row, IEnumerable<ContentData> existingItems) { row.LogContentInfo("checking for existence in ektron."); ContentData item; if (row.IsNew()) { row.LogContentInfo("no contentId found, checking by title and folder path."); string title = DestinationHelper.EncodeTitle(row["title"].ToString()); string folderPath = row["folderPath"].ToString(); item = existingItems.FirstOrDefault(ei => ei.Title == title && ei.Path == folderPath); } else { long id = (long)row["contentId"]; item = existingItems.FirstOrDefault(ei => ei.Id == id); } if (item != null) { row.LogContentInfo("found existing item."); } else { row.LogContentInfo("did not find existing item."); } return item; }