Sets the number and types of parameters for a method.
Assembly: mscorlib (in mscorlib.dll)
If the number and types of the parameters are known when the method is defined, they can be set using any overload of the TypeBuilder.DefineMethod method that accepts an array of parameter types. However, a generic method can have parameters whose types are specified by one or more of its own generic type parameters, which cannot be defined until after the method has been defined. Use this method to set the parameter types in that case.
If the return type has optional or required custom modifiers, such as IsConst, use the SetSignature(Type, Type, Type, Type, Type, Type) method overload.
Calling this method replaces any parameter types that were set using the TypeBuilder.DefineMethod method.
The following code example uses the DefineGenericParameters method to make a method generic. The method is used to give the method one parameter, whose type will be specified by the first generic type parameter. The SetReturnType method is used to give the method a return type, specified by the second generic type parameter.
This code is part of a larger example provided for the DefineGenericParameters method.