共用方式為


ShareLeaseClient.BreakAsync(CancellationToken) Method

Definition

The BreakAsync(CancellationToken) operation breaks the files's previously-acquired lease (if it exists).

Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not required to specify a matching lease ID.

A lease that has been broken can also be released. A client can immediately acquire a file lease that has been released.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileLease>> BreakAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member BreakAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileLease>>
override this.BreakAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Files.Shares.Models.ShareFileLease>>
Public Overridable Function BreakAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ShareFileLease))

Parameters

cancellationToken
CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

A Response<T> describing the broken lease.

Remarks

A RequestFailedException will be thrown if a failure occurs.

Applies to