Get the Type of a generic type argument at certain position from a method.

Namespace: Cartella.Support
Assembly: CartellaBase (in CartellaBase.dll) Version: 4.1.0.171 (4.1.0.171)

Syntax

C#
public static Type GetGenericArgumentType(
	MethodBase method,
	int genericArgumentIndex
)
Visual Basic
Public Shared Function GetGenericArgumentType ( _
	method As MethodBase, _
	genericArgumentIndex As Integer _
) As Type
Visual C++
public:
static Type^ GetGenericArgumentType(
	MethodBase^ method, 
	int genericArgumentIndex
)

Parameters

method
Type: System.Reflection..::..MethodBase
Generic method from which to retrieve type information
genericArgumentIndex
Type: System..::..Int32
Position of generic argument

Return Value

Type of generic argument or not if position is out of range

Exceptions

ExceptionCondition
System..::..ArgumentExceptionThrown when method is not a generic method or position is out of range

See Also