Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
public void RegisterForDisposal( IDisposable disposable )
Public Sub RegisterForDisposal ( disposable As IDisposable )
- Type: SystemIDisposable
The instance that should be disposed when the scope ends.
|ArgumentNullException||Thrown when one of the arguments is a null reference.|
|ObjectDisposedException||Thrown when the scope has been disposed.|
Instances that are registered for disposal, will be disposed in opposite order of registration and they are guaranteed to be disposed when Dispose is called (even when exceptions are thrown). This mimics the behavior of the C# and VB
Thread safety: Calls to this method are thread safe.