Creates a new Registration instance defining the creation of the
            specified TService using the supplied instanceCreator
            with the caching as specified by this lifestyle.
            
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
public Registration CreateRegistration<TService>( Func<TService> instanceCreator, Container container ) where TService : class
Parameters
- instanceCreator
 - Type: SystemFuncTService
A delegate that will create a new instance of TService every time it is called. - container
 - Type: SimpleInjectorContainer
The Container instance for which a Registration must be created. 
Type Parameters
- TService
 - The interface or base type that can be used to retrieve the instances.
 
Return Value
Type: RegistrationA new Registration instance.
Exceptions
| Exception | Condition | 
|---|---|
| ArgumentNullException | Thrown when either instanceCreator or container are null references. | 
See Also