Adc.Odoo.Service.Infrastructure.Extensions.ExtensionsForType.IsGenericCollection C# (CSharp) Метод

IsGenericCollection() публичный статический Метод

public static IsGenericCollection ( this referenceType ) : bool
referenceType this
Результат bool
        public static bool IsGenericCollection(this Type referenceType)
        {
            if (!referenceType.IsGenericType)
            {
                return false;
            }

            var enumerableType = typeof(IEnumerable<>).MakeGenericType(referenceType.GetGenericArguments());
            var interfaces = referenceType.GetInterfaces();
            return interfaces.Contains(enumerableType);
        }