Type.GenericTypeArguments property vs Type.GetGenericArguments() method

typeof(List<>) is an example where they differ. The property returns an empty array, while the method returns an array with a generic T in it. (this T has IsGenericParameter true)

From reading the documentation, I think that you can think of GenericTypeArguments as GetGenericArguments().Where(t => !t.IsGenericParameter).ToArray(), i.e. only the concrete types. See also ContainsGenericParameters.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)