GetConstructor Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Searches for a public instance constructor whose parameters match the types in the specified array.

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

public ConstructorInfo GetConstructor(
	Type[] types
)

Parameters

types
Type: array<System..::..Type>[]()[][]
An array of Type objects representing the number, order, and type of the parameters for the desired constructor.
-or-
An empty array of Type objects, to get a constructor that takes no parameters. Such an empty array is provided by the static field Type.EmptyTypes.

Return Value

Type: System.Reflection..::..ConstructorInfo
An object representing the public instance constructor whose parameters match the types in the parameter type array, if found; otherwise, nullNothingnullptrunita null reference (Nothing in Visual Basic).

If the requested constructor is non-public, this method returns nullNothingnullptrunita null reference (Nothing in Visual Basic).

If the current Type represents a constructed generic type, this method returns the ConstructorInfo with the type parameters replaced by the appropriate type arguments. If the current Type represents a type parameter in the definition of a generic type or generic method, this method always returns nullNothingnullptrunita null reference (Nothing in Visual Basic).

Show: