RegistrationBuildTransientExpressionTService Method (FuncTService)

Simple Injector
Builds an Expression that describes the creation of the TService using the supplied instanceCreator. The returned Expression might be intercepted by a Container.ExpressionBuilding event, and the instanceCreator will have been wrapped with a delegate that executes the registered initializers that are applicable to the given TService (if any).

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

protected Expression BuildTransientExpression<TService>(
	Func<TService> instanceCreator
)
where TService : class

Parameters

instanceCreator
Type: SystemFuncTService
The delegate supplied by the user that allows building or creating new instances.

Type Parameters

TService
The interface or base type that can be used to retrieve instances.

Return Value

Type: Expression
An Expression.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when one of the arguments is a null reference.
See Also

Reference