LifestyleCreateProducerTService, TImplementation Method (Container)

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

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

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

Parameters

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.
TImplementation
The concrete type that will be created.

Return Value

Type: InstanceProducerTService
A new InstanceProducer instance.
Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when container is a null reference.
See Also

Reference