C#判断一个类型是否是集合类型

C#判断一个类型是否是集合类型:

typeof(T).GetTypeInfo().ImplementedInterfaces.Contains(typeof(IEnumerable))