sdk/dotnet/src/Microsoft.Datasync.Client/Offline/DeltaTokenStore.cs
/// <summary>
/// Sets the delta token for a table/queryId from persistent store.
/// </summary>
/// <remarks>
/// Delta tokens are stored for each query (identified by a user-specified queryId) to determine
/// the minimum value for updatedAt that must be queried to get incremental changes to the table.
/// </remarks>
/// <param name="tableName">The name of the table.</param>
/// <param name="queryId">The query ID of the table.</param>
/// <param name="deltaToken">The value of the delta token.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to acquire.</param>
/// <returns>A task that completes when the delta token has been set in the persistent store.</returns>
Sets the delta token for a table/queryId from persistent store.
Sets the delta token for a table / queryId from persistent store .
public virtual async Task SetDeltaTokenAsync(string tableName, string queryId, DateTimeOffset deltaToken, CancellationToken cancellationToken = default)
        {
            var key = GetKey(tableName, queryId);
            using (await cacheLock.AcquireAsync(cancellationToken).ConfigureAwait(false))
            {
                long unixms = deltaToken.ToUnixTimeMilliseconds();
                var obj = new JObject()
                {
                    { SystemProperties.JsonIdProperty, key },
                    { "value", unixms }
                };
                await OfflineStore.UpsertAsync(SystemTables.Configuration, new[] { obj }, false, cancellationToken).ConfigureAwait(false);
                cache[key] = DateTimeOffset.FromUnixTimeMilliseconds(unixms);
            }
        }
public virtual async Task SetDeltaTokenAsync ( string tableName , string queryId , DateTimeOffset deltaToken , CancellationToken cancellationToken = default ) { var key = GetKey ( tableName , queryId ) ; using ( await cacheLock . AcquireAsync ( cancellationToken ) . ConfigureAwait ( false ) ) { long unixms = deltaToken . ToUnixTimeMilliseconds ( ) ; var obj = new JObject ( ) { { SystemProperties . JsonIdProperty , key } , { " " , unixms } } ; await OfflineStore . UpsertAsync ( SystemTables . Configuration , new [ ] { obj } , false , cancellationToken ) . ConfigureAwait ( false ) ; cache [ key ] = DateTimeOffset . FromUnixTimeMilliseconds ( unixms ) ; } }
Sets the delta token for a table/queryId from persistent store.
Sets the delta token for a table / queryId from persistent store .
A task that completes when the delta token has been set in the persistent store.
A task that completes when the delta token has been set in the persistent store .
tableName
string
The name of the table.
The name of the table .
queryId
string
The query ID of the table.
The query ID of the table .
deltaToken
DateTimeOffset
The value of the delta token.
The value of the delta token .
cancellationToken
CancellationToken
A  to acquire.
A to acquire .
remarks
Delta tokens are stored for each query (identified by a user-specified queryId) to determine
the minimum value for updatedAt that must be queried to get incremental changes to the table.
Delta tokens are stored for each query ( identified by a user - specified queryId ) to determine the minimum value for updatedAt that must be queried to get incremental changes to the table .