Adds the disposable to the list of items that will get disposed when the
container gets disposed.
Namespace: SimpleInjector
Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
Syntax
Parameters
- disposable
- Type: SystemObject
The instance that should be disposed when the scope ends.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when one of the arguments is a null reference. |
ArgumentException | Thrown when one of the arguments is not a disposable type. |
ObjectDisposedException | Thrown when the container has been disposed. |
Remarks
See Also