IConstructorResolutionBehaviorTryGetConstructor Method

Simple Injector
Gets the given implementationType's constructor that can be used by the container to create that instance. In case no suitable constructor can be found, null is returned and the errorMessage will contain the reason why the resolution failed.

Namespace:  SimpleInjector.Advanced
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax

ConstructorInfo TryGetConstructor(
	Type implementationType,
	out string errorMessage
)

Parameters

implementationType
Type: SystemType
Type of the implementation to find a suitable constructor for.
errorMessage
Type: SystemString
The reason why the resolution failed.

Return Value

Type: ConstructorInfo
The ConstructorInfo or null.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when implementationType is null.
See Also

Reference