I need to know if the type of a property in a class is a generic collection (List, ObservableCollection) using the PropertyInfo class.
foreach (PropertyInfo p
GetGenericTypeDefinition and typeof(Collection<>) will do the job:
GetGenericTypeDefinition
typeof(Collection<>)
if(p.PropertyType.IsGenericType && typeof(Collection<>).IsAssignableFrom(p.PropertyType.GetGenericTypeDefinition())