sdk/dotnet/src/Microsoft.Datasync.Client/Offline/Queue/OperationsQueue.cs
/// <summary>
/// Deletes an operation from the operations queue.
/// </summary>
/// <param name="id">The ID of the operation.</param>
/// <param name="version">The version of the operation.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
/// <returns>A task that completes when the operation is removed.</returns>
Deletes an operation from the operations queue.
Deletes an operation from the operations queue .
public async Task<bool> DeleteOperationByIdAsync(string id, long version, CancellationToken cancellationToken = default)
        {
            using (await AcquireLockAsync(cancellationToken).ConfigureAwait(false))
            {
                EnsureQueueIsInitialized();
                try
                {
                    var operation = await GetOperationByIdAsync(id, cancellationToken).ConfigureAwait(false);
                    if (operation == null || operation.Version != version)
                    {
                        return false;
                    }
                    await OfflineStore.DeleteAsync(SystemTables.OperationsQueue, new[] { id }, cancellationToken).ConfigureAwait(false);
                    Interlocked.Decrement(ref pendingOperations);
                    return true;
                }
                catch (Exception ex)
                {
                    throw new OfflineStoreException("Failed to delete the operation from the local store", ex);
                }
            }
        }
public async Task < bool > DeleteOperationByIdAsync ( string id , long version , CancellationToken cancellationToken = default ) { using ( await AcquireLockAsync ( cancellationToken ) . ConfigureAwait ( false ) ) { EnsureQueueIsInitialized ( ) ; try { var operation = await GetOperationByIdAsync ( id , cancellationToken ) . ConfigureAwait ( false ) ; if ( operation == null || operation . Version != version ) { return false ; } await OfflineStore . DeleteAsync ( SystemTables . OperationsQueue , new [ ] { id } , cancellationToken ) . ConfigureAwait ( false ) ; Interlocked . Decrement ( ref pendingOperations ) ; return true ; } catch ( Exception ex ) { throw new OfflineStoreException ( " " , ex ) ; } } }
Deletes an operation from the operations queue.
Deletes an operation from the operations queue .
A task that completes when the operation is removed.
A task that completes when the operation is removed .
id
string
The ID of the operation.
The ID of the operation .
version
long
The version of the operation.
The version of the operation .
cancellationToken
CancellationToken
A  to observe.
A to observe .