Type t = typeof(List<>); if (t.IsGenericType) { Console.WriteLine("List<> is a generic type."); }
Type t = typeof(ListIn both examples, the package library is the System namespace.); if (t.IsGenericType && !t.IsGenericTypeDefinition) { Console.WriteLine("List is a constructed generic type."); }