sdk/dotnet/src/Microsoft.Datasync.Client/Offline/DeltaTokenStore.cs
/// <summary>
/// Obtains the current 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="cancellationToken">A <see cref="CancellationToken"/> to acquire.</param>
/// <returns>A task that returns the delta token when complete.</returns>
Obtains the current delta token for a table/queryId from persistent store.
Obtains the current delta token for a table / queryId from persistent store .
public virtual async Task<DateTimeOffset> GetDeltaTokenAsync(string tableName, string queryId, CancellationToken cancellationToken = default)
        {
            string key = GetKey(tableName, queryId);
            using (await cacheLock.AcquireAsync(cancellationToken).ConfigureAwait(false))
            {
                if (cache.TryGetValue(key, out DateTimeOffset cacheValue))
                {
                    return cacheValue;
                }
                JObject setting = await OfflineStore.GetItemAsync(SystemTables.Configuration, key, cancellationToken).ConfigureAwait(false);
                long unixms = setting?.Value<long>("value") ?? 0L;
                cache[key] = DateTimeOffset.FromUnixTimeMilliseconds(unixms);
                return cache[key];
            }
        }
public virtual async Task < DateTimeOffset > GetDeltaTokenAsync ( string tableName , string queryId , CancellationToken cancellationToken = default ) { string key = GetKey ( tableName , queryId ) ; using ( await cacheLock . AcquireAsync ( cancellationToken ) . ConfigureAwait ( false ) ) { if ( cache . TryGetValue ( key , out DateTimeOffset cacheValue ) ) { return cacheValue ; } JObject setting = await OfflineStore . GetItemAsync ( SystemTables . Configuration , key , cancellationToken ) . ConfigureAwait ( false ) ; long unixms = setting ? . Value < long > ( " " ) ?? 0L ; cache [ key ] = DateTimeOffset . FromUnixTimeMilliseconds ( unixms ) ; return cache [ key ] ; } }
Obtains the current delta token for a table/queryId from persistent store.
Obtains the current delta token for a table / queryId from persistent store .
A task that returns the delta token when complete.
A task that returns the delta token when complete .
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 .
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 .