sdk/dotnet/src/Microsoft.Datasync.Client/Offline/Queue/OperationsQueue.cs
/// <summary>
/// Retrieves an existing operation (by table/ID) from the operations queue.
/// </summary>
/// <param name="tableName">The name of the offline table.</param>
/// <param name="itemId">The ID of the item.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
/// <returns>A task that returns the existing operation, or <c>null</c> if no operation exists when complete.</returns>
Retrieves an existing operation (by table/ID) from the operations queue.
Retrieves an existing operation ( by table / ID ) from the operations queue .
public async Task<TableOperation> GetOperationByItemIdAsync(string tableName, string itemId, CancellationToken cancellationToken = default)
        {
            EnsureQueueIsInitialized();
            QueryDescription query = new(SystemTables.OperationsQueue)
            {
                Filter = new BinaryOperatorNode(BinaryOperatorKind.And, Compare(BinaryOperatorKind.Equal, "tableName", tableName), Compare(BinaryOperatorKind.Equal, "itemId", itemId))
            };
            var page = await OfflineStore.GetPageAsync(query, cancellationToken).ConfigureAwait(false);
            return page.Items?.FirstOrDefault() is JObject operation ? TableOperation.Deserialize(operation) : null;
        }
public async Task < TableOperation > GetOperationByItemIdAsync ( string tableName , string itemId , CancellationToken cancellationToken = default ) { EnsureQueueIsInitialized ( ) ; QueryDescription query = new ( SystemTables . OperationsQueue ) { Filter = new BinaryOperatorNode ( BinaryOperatorKind . And , Compare ( BinaryOperatorKind . Equal , " " , tableName ) , Compare ( BinaryOperatorKind . Equal , " " , itemId ) ) } ; var page = await OfflineStore . GetPageAsync ( query , cancellationToken ) . ConfigureAwait ( false ) ; return page . Items ? . FirstOrDefault ( ) is JObject operation ? TableOperation . Deserialize ( operation ) : null ; }
Retrieves an existing operation (by table/ID) from the operations queue.
Retrieves an existing operation ( by table / ID ) from the operations queue .
A task that returns the existing operation, or null
A task that returns the existing operation or null
tableName
string
The name of the offline table.
The name of the offline table .
itemId
string
The ID of the item.
The ID of the item .
cancellationToken
CancellationToken
A  to observe.
A to observe .