sdk/dotnet/src/Microsoft.Datasync.Client/Offline/Queue/InsertOperation.cs
/// <summary>
/// Collapse this operation with a new operation by cancellation of either operation.
/// </summary>
/// <param name="newOperation">The new operation.</param>
Collapse this operation with a new operation by cancellation of either operation.
Collapse this operation with a new operation by cancellation of either operation .
public override void CollapseOperation(TableOperation newOperation)
        {
            if (newOperation.ItemId != ItemId)
            {
                throw new ArgumentException("ItemId does not match", nameof(newOperation));
            }
            if (newOperation is DeleteOperation)
            {
                Cancel();
                newOperation.Cancel();
            }
            if (newOperation is UpdateOperation)
            {
                Update();
                newOperation.Cancel();
            }
        }
public override void CollapseOperation ( TableOperation newOperation ) { if ( newOperation . ItemId != ItemId ) { throw new ArgumentException ( " " , nameof ( newOperation ) ) ; } if ( newOperation is DeleteOperation ) { Cancel ( ) ; newOperation . Cancel ( ) ; } if ( newOperation is UpdateOperation ) { Update ( ) ; newOperation . Cancel ( ) ; } }
Collapse this operation with a new operation by cancellation of either operation.
Collapse this operation with a new operation by cancellation of either operation .
// An insert followed by a delete is a no-op, so cancel both operations. // An insert followed by an update is still an insert, so cancel the update.
newOperation
TableOperation
The new operation.
The new operation .