I hope I understand your question correctly. First, a more precise definition of the type of collection is required. Here is what I will use:
Collections are shared
Collections implement one of the standard collection interfaces, such as IList<T>, ICollection<T>or IEnumerable<T>. In this example, the type of the collection is the type obtained from IEnumerable<T>.
, , , GetInterfaces(), , IsGenericType, (.. IList<String> IList<>) GetGenericTypeDefinition():
var genericCollectionType = typeof(IEnumerable<>);
var isCollection = pi
.PropertyType
.GetInterfaces()
.Where(type => type.IsGenericType)
.Select(type => type.GetGenericTypeDefinition())
.Contains(genericCollectionType);
if (isCollection) {
...
}