LifestyleTransient Field

Simple Injector
The lifestyle instance that doesn't cache instances. A new instance of the specified component is created every time the registered service is requested or injected.

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

public static readonly Lifestyle Transient

Field Value

Type: Lifestyle
Examples

The following example registers the SomeServiceImpl implementation for the ISomeService service type using the Transient lifestyle:
C#
var container = new Container();

container.Register<ISomeService, SomeServiceImpl>(Lifestyle.Transient);
Note that Transient is the default lifestyle, the previous registration can be reduced to the following:
C#
var container = new Container();

// Transient registration.
container.Register<ISomeService, SomeServiceImpl>();
See Also

Reference