Gets the given implementationType's constructor that can be used by the
container to create that instance.
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
public static ConstructorInfo GetConstructor( this IConstructorResolutionBehavior behavior, Type implementationType )
Parameters
- behavior
- Type: SimpleInjector.AdvancedIConstructorResolutionBehavior
The behavior. - implementationType
- Type: SystemType
Type of the implementation to find a suitable constructor for.
Return Value
Type: ConstructorInfoThe ConstructorInfo. This method never returns null.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IConstructorResolutionBehavior. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Exceptions
Exception | Condition |
---|---|
ActivationException | Thrown when no suitable constructor could be found. |
See Also