Scope.Create method (1 of 2)

Creates a Scope for the specified delegate.

public static Scope Create(Action? dispose)
parameter description
dispose The delegate.

Return Value

An instance of Scope that calls the delegate when disposed.

Remarks

If dispose is null, the instance does nothing when disposed.

See Also


Scope.Create<T> method (2 of 2)

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.

Return Value

An instance of Scope that disposes the object when disposed.

Remarks

If disposable is null, the instance does nothing when disposed.

See Also