sdk/dotnet/src/Microsoft.Datasync.Client/Offline/Queue/OperationsQueue.cs
/// <summary>
/// Tries to update the operation state within the queue, and throws an error if it can't/
/// </summary>
/// <param name="operation">The operation to update.</param>
/// <param name="state">The new state of the operation.</param>
/// <param name="batch">An <see cref="OperationBatch"/> to report any failure..</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
Tries to update the operation state within the queue, and throws an error if it can't
Tries to update the operation state within the queue and throws an error if it can ' t
public virtual async Task TryUpdateOperationStateAsync(TableOperation operation, TableOperationState state, OperationBatch batch = null, CancellationToken cancellationToken = default)
        {
            Arguments.IsNotNull(operation, nameof(operation));
            try
            {
                operation.State = state;
                await UpdateOperationAsync(operation, cancellationToken).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                batch?.Abort(PushStatus.CancelledByOfflineStoreError);
                throw new OfflineStoreException($"Failed to set operation state for QID '{operation.Id}' to '{state}' in the offline store.", ex);
            }
        }
public virtual async Task TryUpdateOperationStateAsync ( TableOperation operation , TableOperationState state , OperationBatch batch = null , CancellationToken cancellationToken = default ) { Arguments . IsNotNull ( operation , nameof ( operation ) ) ; try { operation . State = state ; await UpdateOperationAsync ( operation , cancellationToken ) . ConfigureAwait ( false ) ; } catch ( Exception ex ) { batch ? . Abort ( PushStatus . CancelledByOfflineStoreError ) ; throw new OfflineStoreException ( $" Failed to set operation state for QID ' { operation . Id } ' to ' { state } ' in the offline store. " , ex ) ; } }
Tries to update the operation state within the queue, and throws an error if it can't
Tries to update the operation state within the queue and throws an error if it can ' t
operation
TableOperation
The operation to update.
The operation to update .
state
TableOperationState
The new state of the operation.
The new state of the operation .
batch
OperationBatch
An  to report any failure
An to report any failure
cancellationToken
CancellationToken
A  to observe.
A to observe .