Ejemplo n.º 1
0
 public GenericTypeInfo GatherTypeInfo(AttributeType propertyAttributes = AttributeType.None)
 {
     DetermineObjectType();
     if (IsPoco)
     {
         Properties = GenericType.GetProperties().ToList();
         for (int i = 0; i < Properties.Count; i++)
         {
             var propInfo = Properties[i];
             ThrowIfPropIsIndexer(propInfo);
             PropertyNames.Add(propInfo.Name);
             PropertiesByName.Add(propInfo.Name, propInfo);
             UnderlyingPropType.Add(propInfo, TryGetUnderlyingType(propInfo));
             TryExtractAttribute(propertyAttributes, propInfo);
             RetrieveAdditionalTypeInfo(propInfo, i);
         }
     }
     return(this);
 }
Ejemplo n.º 2
0
        private void AddUnderlyingType(PropertyInfo propInfo)
        {
            Type t = Nullable.GetUnderlyingType(propInfo.PropertyType) ?? propInfo.PropertyType;

            UnderlyingPropType.Add(propInfo, t);
        }