How to tell whether a Type is a list or array or IEnumerable or
Check typeof(IEnumerable).IsAssignableFrom(type)
.
Every collection type, including arrays and IEnumerable<T>
, implements IEnumerable
.
if (objType.IsArray || objType.IsGenericType)
{
}