sdk/dotnet/src/Microsoft.Datasync.Client/Offline/SyncContext.cs
/// <summary>
/// Deletes an item from the offline table.
/// </summary>
/// <param name="tableName">The name of the offline table.</param>
/// <param name="instance">The instance to delete from the table.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
/// <returns>A task that returns the response when complete.</returns>
Deletes an item from the offline table.
Deletes an item from the offline table .
public async Task DeleteItemAsync(string tableName, JObject instance, CancellationToken cancellationToken = default)
        {
            EnsureContextIsInitialized();
            string itemId = ServiceSerializer.GetId(instance);
            var originalInstance = await GetItemAsync(tableName, itemId, cancellationToken).ConfigureAwait(false);
            if (originalInstance == null)
            {
                throw new InvalidOperationException($"The item with ID '{itemId}' is not in the offline store.");
            }
            var operation = new DeleteOperation(tableName, itemId) { Item = originalInstance };
            await EnqueueOperationAsync(operation, originalInstance, cancellationToken).ConfigureAwait(false);
        }
public async Task DeleteItemAsync ( string tableName , JObject instance , CancellationToken cancellationToken = default ) { EnsureContextIsInitialized ( ) ; string itemId = ServiceSerializer . GetId ( instance ) ; var originalInstance = await GetItemAsync ( tableName , itemId , cancellationToken ) . ConfigureAwait ( false ) ; if ( originalInstance == null ) { throw new InvalidOperationException ( $" The item with ID ' { itemId } ' is not in the offline store. " ) ; } var operation = new DeleteOperation ( tableName , itemId ) { Item = originalInstance } ; await EnqueueOperationAsync ( operation , originalInstance , cancellationToken ) . ConfigureAwait ( false ) ; }
Deletes an item from the offline table.
Deletes an item from the offline table .
A task that returns the response when complete.
A task that returns the response when complete .
tableName
string
The name of the offline table.
The name of the offline table .
instance
JObject
The instance to delete from the table.
The instance to delete from the table .
cancellationToken
CancellationToken
A  to observe.
A to observe .