InstanceProducerFromExpression Method

Simple Injector
Creates a new InstanceProducer based on the given serviceType and expression where the expression will be used as-is; no interception (using ExpressionBuilt) such as decorators will be applied.

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

public static InstanceProducer FromExpression(
	Type serviceType,
	Expression expression,
	Container container
)

Parameters

serviceType
Type: SystemType
The service type for which this instance is created.
expression
Type: System.Linq.ExpressionsExpression
The expression that describes the instance to be produced.
container
Type: SimpleInjectorContainer
The Container instance for this registration.

Return Value

Type: InstanceProducer
A new InstanceProducer that describes the expression.
See Also

Reference