sdk/dotnet/src/Microsoft.Datasync.Client/Offline/Queue/InsertOperation.cs
/// <summary>
/// Executes the operation on the offline store.
/// </summary>
/// <param name="store">The offline store.</param>
/// <param name="item">The item to use for the store operation.</param>
/// <returns>A task that completes when the store operation is completed.</returns>
Executes the operation on the offline store.
Executes the operation on the offline store .
public override async Task ExecuteOperationOnOfflineStoreAsync(IOfflineStore store, JObject item, CancellationToken cancellationToken = default)
        {
            var existingItem = await store.GetItemAsync(TableName, ItemId, cancellationToken).ConfigureAwait(false);
            if (existingItem != null)
            {
                throw new OfflineStoreException("Insert failed - the item already exists in the offline store");
            }
            await store.UpsertAsync(TableName, new[] { item }, false, cancellationToken).ConfigureAwait(false);
        }
public override async Task ExecuteOperationOnOfflineStoreAsync ( IOfflineStore store , JObject item , CancellationToken cancellationToken = default ) { var existingItem = await store . GetItemAsync ( TableName , ItemId , cancellationToken ) . ConfigureAwait ( false ) ; if ( existingItem != null ) { throw new OfflineStoreException ( " " ) ; } await store . UpsertAsync ( TableName , new [ ] { item } , false , cancellationToken ) . ConfigureAwait ( false ) ; }
Executes the operation on the offline store.
Executes the operation on the offline store .
A task that completes when the store operation is completed.
A task that completes when the store operation is completed .
store
IOfflineStore
The offline store.
The offline store .
item
JObject
The item to use for the store operation.
The item to use for the store operation .
cancellationToken
CancellationToken