I have changed the line to "FirstOrDefault() ?? prop.PropertyType.GetElementType();", because there are IEnumerable types, which do not subclass IEnumerable<T>, like Arrays. For Arrays you get the element type by using the GetElementType() instead. Array Element types cannot be retriebed using the generic arguments of IEnumerable. The ?? operator means that the right side of the operator will be used, if the left side is null.