sdk/dotnet/src/Microsoft.Datasync.Client/Offline/SyncContext.cs
/// <summary>
/// Replaces an item into the remote table.
/// </summary>
/// <param name="tableName">The name of the offline table.</param>
/// <param name="instance">The instance to replace into the table.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
/// <returns>A task that returns the replaced data when complete.</returns>
Replaces an item into the remote table.
Replaces an item into the remote table .
public async Task ReplaceItemAsync(string tableName, JObject instance, CancellationToken cancellationToken = default)
        {
            EnsureContextIsInitialized();
            string itemId = ServiceSerializer.GetId(instance);
            instance = ServiceSerializer.RemoveSystemProperties(instance, out string version);
            if (version != null)
            {
                instance[SystemProperties.JsonVersionProperty] = version;
            }
            var operation = new UpdateOperation(tableName, itemId);
            await EnqueueOperationAsync(operation, instance, cancellationToken).ConfigureAwait(false);
        }
public async Task ReplaceItemAsync ( string tableName , JObject instance , CancellationToken cancellationToken = default ) { EnsureContextIsInitialized ( ) ; string itemId = ServiceSerializer . GetId ( instance ) ; instance = ServiceSerializer . RemoveSystemProperties ( instance , out string version ) ; if ( version != null ) { instance [ SystemProperties . JsonVersionProperty ] = version ; } var operation = new UpdateOperation ( tableName , itemId ) ; await EnqueueOperationAsync ( operation , instance , cancellationToken ) . ConfigureAwait ( false ) ; }
Replaces an item into the remote table.
Replaces an item into the remote table .
A task that returns the replaced data when complete.
A task that returns the replaced data when complete .
tableName
string
The name of the offline table.
The name of the offline table .
instance
JObject
The instance to replace into the table.
The instance to replace into the table .
cancellationToken
CancellationToken
A  to observe.
A to observe .