public virtual void AddFieldConfiguration(FieldConfiguration fieldConfiguration) { if (Fields.Any(f => f.PropertyName == fieldConfiguration.PropertyName)) { throw new FluentDynamoDbMappingException(string.Format("Property {0} has already been mapped", fieldConfiguration.PropertyName)); } _fields.Add(fieldConfiguration); }
private static bool IsEnumerable(FieldConfiguration field) { return(field.Type.IsGenericType && field.Type.GetGenericTypeDefinition() == typeof(IEnumerable <>)); }
private static object GetPropertyValue(object entity, FieldConfiguration field) { return(entity.GetType().GetProperty(field.PropertyName).GetValue(entity, null)); }