Example #1
0
        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);
        }
Example #2
0
 private static bool IsEnumerable(FieldConfiguration field)
 {
     return(field.Type.IsGenericType && field.Type.GetGenericTypeDefinition() == typeof(IEnumerable <>));
 }
Example #3
0
 private static object GetPropertyValue(object entity, FieldConfiguration field)
 {
     return(entity.GetType().GetProperty(field.PropertyName).GetValue(entity, null));
 }