LifestyleCreateProducerTService Method (Type, Container)

Simple Injector
Creates a new InstanceProducer instance for the given TService that will create new instances of specified implementationType caching as specified by this lifestyle.

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

public InstanceProducer<TService> CreateProducer<TService>(
	Type implementationType,
	Container container
)
where TService : class

Parameters

implementationType
Type: SystemType
The concrete type that will be created.
container
Type: SimpleInjectorContainer
The Container instance for which a InstanceProducer must be created.

Type Parameters

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

Return Value

Type: InstanceProducerTService
A new InstanceProducer instance.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when either implementationType or container are null references.
See Also

Reference