System.Reflection.Emit.GenericTypeParameterBuilder Class

Defines and creates generic type parameters for dynamically defined generic types and methods. This class cannot be inherited.

See Also: GenericTypeParameterBuilder Members


public sealed class GenericTypeParameterBuilder : System.Reflection.TypeInfo


You can get an array of System.Reflection.Emit.GenericTypeParameterBuilder objects by using the TypeBuilder.DefineGenericParameters(String[]) method to add type parameters to a dynamic type, thus making it a generic type, or by using the MethodBuilder.DefineGenericParameters(String[]) method to add type parameters to a dynamic method. Use the System.Reflection.Emit.GenericTypeParameterBuilder objects to add constraints to the type parameters. Constraints are of three kinds:

Interface constraints and special constraints cannot be retrieved using methods of the System.Reflection.Emit.GenericTypeParameterBuilder class. Once you have created the generic type that contains the type parameters, you can use its Type object to reflect the constraints. Use the Type.GetGenericArguments method to get the type parameters, and for each type parameter use the Type.GetGenericParameterConstraints method to get the base type constraint and interface constraints, and the Type.GenericParameterAttributes property to get the special constraints.


Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions:,
Since: .NET 2.0