TypeBuilder.GetGenericTypeDefinition Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a Type object that represents a generic type definition from which the current type can be obtained.

Namespace:   System.Reflection.Emit
Assembly:  mscorlib (in mscorlib.dll)

override GetGenericTypeDefinition : unit -> Type

Return Value

Type: System.Type

A Type object representing a generic type definition from which the current type can be obtained.

Exception Condition
InvalidOperationException

The current type is not generic. That is, IsGenericType returns false.

If you call the GetGenericTypeDefinition method on a TypeBuilder object for which the IsGenericType property returns true, the GetGenericTypeDefinition property returns the current instance. A TypeBuilder that represents a generic type is always a generic type definition.

If you used the MakeGenericType method to construct a generic type from a TypeBuilder object that represents a generic type definition, using the Type.GetGenericTypeDefinition method on the constructed type gets back the TypeBuilder object that represents the generic type definition.

.NET Framework
Available since 2.0
Silverlight
Available since 2.0
Return to top
Show: