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); }
private void AddUnderlyingType(PropertyInfo propInfo) { Type t = Nullable.GetUnderlyingType(propInfo.PropertyType) ?? propInfo.PropertyType; UnderlyingPropType.Add(propInfo, t); }