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: InstanceProducerTServiceA new InstanceProducer instance.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when either implementationType or container are null references. |
See Also