PredicateContextConsumer Property

Simple Injector
Gets the contextual information of the consuming component that directly depends on the registered service. This property will never return null, but instead throw an exception when the service is requested directly from the container.

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

public InjectionConsumerInfo Consumer { get; }

Property Value

Type: InjectionConsumerInfo
The InjectionConsumerInfo.
Exceptions

ExceptionCondition
InvalidOperationExceptionThrown when the service described by this instance is requested directly from the container, opposed to being injected into a consumer.
See Also

Reference