The lifestyle that caches components according to the lifetime of the container's configured scoped lifestyle.
In case the type of a cached instance implements IDisposable, the container will ensure its disposal when the active scope gets disposed.
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 4.9.0
public static readonly ScopedLifestyle Scoped
Public Shared ReadOnly Scoped As ScopedLifestyle
Field ValueType: ScopedLifestyle
// Create a Container instance, configured with a scoped lifestyle. var container = new Container(new WebRequestLifestyle()); container.Register<ITimeProvider, RealTimeProvider>(Lifestyle.Scoped);