Adds the disposable to the list of items that will get disposed when the
scope ends.
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
Parameters
- container
- Type: SimpleInjectorContainer
The Container instance. - disposable
- Type: SystemIDisposable
The instance that should be disposed when the scope ends.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when one of the arguments is a null reference. |
InvalidOperationException | Will be thrown when there is currently no active scope for the supplied container. |
See Also