ContainerScope Class

Simple Injector
The scope that manages the lifetime of singletons and other container-controlled instances.
Inheritance Hierarchy

SystemObject
  SimpleInjector.AdvancedApiObject
    SimpleInjectorContainerScope

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

public class ContainerScope : ApiObject

The ContainerScope type exposes the following members.

Methods

  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from ApiObject.)
Public methodGetDisposables
Returns the list of IDisposable instances that will be disposed of when this instance is being disposed. The list contains scoped instances that are cached in this instance, and instances explicitly registered for disposal using RegisterForDisposal(IDisposable). The instances are returned in order of creation/registration. When Container.Dispose is called, the scope will ensure Dispose is called on each instance in this list. The instance will be disposed in opposite order as they appear in the list.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from ApiObject.)
Public methodGetItem
Retrieves an item from the scope stored by the given key or null when no item is stored by that key.
Public methodGetOrSetItemT
Adds an item by the given key in the container by using the specified function, if the key does not already exist. This operation is atomic.
Public methodGetType
Gets the Type of the current instance.
(Inherited from ApiObject.)
Public methodRegisterForDisposal
Adds the disposable to the list of items that will get disposed when the container gets disposed.
Public methodSetItem
Stores an item by the given key in the scope.
Public methodToString
Returns a string that represents the current object.
(Inherited from ApiObject.)
Public methodWhenScopeEnds
Allows registering an action delegate that will be called when the container gets disposed, but before the container disposes any instances.
Top
See Also

Reference