CreateInstanceAccessorCreateInstance Method

The CreateInstance(Object) overload can be used for any number of parameters or for constructors with ref/ parameters. The other non-generic overloads can be used for constructors with no more than four parameters. And if you know the type of the created instance and the parameter types at compile time, then you can use the generic overloads for the best performance.

Overload List

CreateInstance Creates a new instance using the associated Type or parameterless constructor.
See the Remarks section of the CreateInstance(Object) overload for details.
CreateInstance(Object) Creates a new instance using the associated constructor with one parameter.
See the Remarks section of the CreateInstance(Object) overload for details.
CreateInstance(Object) Creates a new instance by the associated ConstructorInfo or Type. For types and parameterless constructors the parameters parameter is omitted.
CreateInstance(Object, Object) Creates a new instance using the associated constructor with two parameters.
See the Remarks section of the CreateInstance(Object) overload for details.
CreateInstance(Object, Object, Object) Creates a new instance using the associated constructor with three parameters.
See the Remarks section of the CreateInstance(Object) overload for details.
CreateInstance(Object, Object, Object, Object) Creates a new instance using the associated constructor with four parameters.
See the Remarks section of the CreateInstance(Object) overload for details.
CreateInstanceTInstance Creates a new instance using the associated Type or parameterless constructor.
CreateInstanceTInstance, T(T) Creates a new instance using the associated constructor with one parameter.
CreateInstanceTInstance, T1, T2(T1, T2) Creates a new instance using the associated constructor with two parameters.
CreateInstanceTInstance, T1, T2, T3(T1, T2, T3) Creates a new instance using the associated constructor with three parameters.
CreateInstanceTInstance, T1, T2, T3, T4(T1, T2, T3, T4) Creates a new instance using the associated constructor with four parameters.

See Also