ContainerRegisterTService, TImplementation Method

Simple Injector
Registers that a new instance of TImplementation will be returned every time a TService is requested (transient).

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

public void Register<TService, TImplementation>()
where TService : class
where TImplementation : class, TService

Type Parameters

TService
The interface or base type that can be used to retrieve the instances.
TImplementation
The concrete type that will be registered.
Exceptions

ExceptionCondition
InvalidOperationException Thrown when this container instance is locked and can not be altered, or when an the TService has already been registered.
ArgumentExceptionThrown when the given TImplementation type is not a type that can be created by the container.
Remarks

This method uses the container's LifestyleSelectionBehavior to select the exact lifestyle for the specified type. By default this will be Transient.
See Also

Reference