Editare

Partajați prin


MetadataBuilder.AddGenericParameterConstraint Method

Definition

Adds a type constraint to a generic parameter.

public:
 System::Reflection::Metadata::GenericParameterConstraintHandle AddGenericParameterConstraint(System::Reflection::Metadata::GenericParameterHandle genericParameter, System::Reflection::Metadata::EntityHandle constraint);
public System.Reflection.Metadata.GenericParameterConstraintHandle AddGenericParameterConstraint (System.Reflection.Metadata.GenericParameterHandle genericParameter, System.Reflection.Metadata.EntityHandle constraint);
member this.AddGenericParameterConstraint : System.Reflection.Metadata.GenericParameterHandle * System.Reflection.Metadata.EntityHandle -> System.Reflection.Metadata.GenericParameterConstraintHandle
Public Function AddGenericParameterConstraint (genericParameter As GenericParameterHandle, constraint As EntityHandle) As GenericParameterConstraintHandle

Parameters

genericParameter
GenericParameterHandle

The generic parameter to constrain.

constraint
EntityHandle

The type constraint, which can be one of the following: a TypeDefinitionHandle, TypeReferenceHandle or a TypeSpecificationHandle.

Returns

A handle to the added generic parameter constraint.

Exceptions

genericParameter doesn't have the expected handle kind.

Remarks

Constraints must be added in the same order as the corresponding generic parameters.

Applies to