SimpleInjector.Lifestyles Namespace

Simple Injector
The SimpleInjector.Lifestyles namespace contains types for implementing custom lifestyles.
Classes

  ClassDescription
Public classCode exampleAsyncScopedLifestyle
Defines a lifestyle that caches instances during the lifetime of an explicitly defined scope using the BeginScope method. An execution context scope flows with the logical execution context. Scopes can be nested and nested scopes will get their own instance. Instances created by this lifestyle can be disposed when the created scope gets disposed.
Public classSingletonLifestyle
The singleton lifestyle.
Public classCode exampleThreadScopedLifestyle
Defines a lifestyle that caches instances during the lifetime of an explicitly defined scope using the BeginScope method. A scope is thread-specific, each thread should define its own scope. Scopes can be nested and nested scopes will get their own instance. Instances created by this lifestyle can be disposed when the created scope gets disposed.