MethodBase.GetGenericArguments Method (System.Reflection) (original) (raw)

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Returns an array of Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition.

public:
 virtual cli::array <Type ^> ^ GetGenericArguments();
public virtual Type[] GetGenericArguments();
[System.Runtime.InteropServices.ComVisible(true)]
public virtual Type[] GetGenericArguments();
abstract member GetGenericArguments : unit -> Type[]
override this.GetGenericArguments : unit -> Type[]
[<System.Runtime.InteropServices.ComVisible(true)>]
abstract member GetGenericArguments : unit -> Type[]
override this.GetGenericArguments : unit -> Type[]
Public Overridable Function GetGenericArguments () As Type()

Returns

An array of Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition. Returns an empty array if the current method is not a generic method.

Attributes

Exceptions

The current object is a ConstructorInfo. Generic constructors are not supported in the .NET Framework version 2.0. This exception is the default behavior if this method is not overridden in a derived class.

Remarks

The elements of the returned array are in the order in which they appear in the list of type parameters for the generic method.

Generic constructors are not supported in the .NET Framework version 2.0. This property throws NotSupportedException if not overridden in a derived class, so an exception is thrown if the current instance is of type ConstructorInfo.

For a list of the invariant conditions for terms specific to generic methods, see the IsGenericMethod property. For a list of the invariant conditions for other terms used in generic reflection, see the Type.IsGenericType property.

Applies to

See also