Assembly: SimpleInjector (in SimpleInjector.dll) Version: 5.3.0
public virtual void WhenScopeEnds( Action action )
Public Overridable Sub WhenScopeEnds ( action As Action )
- Type: SystemAction
The delegate to run when the scope ends.
|ArgumentNullException||Thrown when one of the arguments is a null reference.|
|ObjectDisposedException||Thrown when the scope has been disposed.|
During the call to Dispose all registered Action delegates are processed in the order of registration. Do note that registered actions are not guaranteed to run. In case an exception is thrown during the call to Dispose, the Scope will stop running any actions that might not have been invoked at that point. Instances that are registered for disposal using RegisterForDisposal(IDisposable) on the other hand, are guaranteed to be disposed. Note that registered actions won't be invoked during a call to Verify.
Thread safety: Calls to this method are thread safe.