private PropertyInfo GetPropertyInfo(SPListItem item, Type entityType, FieldToEntityPropertyMapping fieldMapping) { PropertyInfo propertyInfo = entityType.GetProperty(fieldMapping.EntityPropertyName); if (propertyInfo == null) { string errorMessage = string.Format(CultureInfo.CurrentCulture , Properties.Resources.PropertyTypeNotMapped , entityType.FullName , fieldMapping.EntityPropertyName , fieldMapping.ListFieldId , item.Name); throw new ListItemFieldMappingException(errorMessage); } return(propertyInfo); }
private void EnsureListFieldID(SPListItem item, Type entityType, FieldToEntityPropertyMapping fieldMapping) { try { var ensuredField = item.Fields[fieldMapping.ListFieldId]; } catch (ArgumentException argumentException) { string errorMessage = string.Format(CultureInfo.CurrentCulture , Properties.Resources.InvalidSPListItem , item.Name , fieldMapping.ListFieldId , fieldMapping.EntityPropertyName , entityType.FullName); throw new ListItemFieldMappingException(errorMessage, argumentException); } }