Creates a Scope for the specified delegate.
public static Scope Create(Action? dispose)
| parameter | description |
|---|---|
| dispose | The delegate. |
An instance of Scope that calls the delegate when disposed.
If dispose is null, the instance does nothing when disposed.
Creates a Scope that disposes the specified object.
public static Scope Create<T>(T disposable)
where T : IDisposable
| parameter | description |
|---|---|
| disposable | The object to dispose. |
An instance of Scope that disposes the object when disposed.
If disposable is null, the instance does nothing when disposed.