Registers that an instance of TConcrete will be returned when it is requested. The instance is cached according to the supplied lifestyle.
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 4.0.0
public void Register<TConcrete>( Lifestyle lifestyle ) where TConcrete : class
Public Sub Register(Of TConcrete As Class) ( lifestyle As Lifestyle )
- Type: SimpleInjectorLifestyle
The lifestyle that specifies how the returned instance will be cached.
- The concrete type that will be registered.
|InvalidOperationException||Thrown when this container instance is locked and can not be altered, or when an the TConcrete has already been registered.|
|ArgumentException||Thrown when the TConcrete is a type that can not be created by the container.|