sdk/dotnet/src/Microsoft.Datasync.Client.SQLiteStore/OfflineSQLiteStore.cs
/// <summary>
/// Returns a single item by the ID of the item.
/// </summary>
/// <param name="tableName">The table name holding the item.</param>
/// <param name="id">The ID of the item.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
/// <returns>A task that returns the item when complete.</returns>
Returns a single item by the ID of the item.
Returns a single item by the ID of the item .
public override async Task<JObject> GetItemAsync(string tableName, string id, CancellationToken cancellationToken = default)
        {
            Arguments.IsValidTableName(tableName, true, nameof(tableName));
            Arguments.IsValidId(id, nameof(id));
            await EnsureInitializedAsync(cancellationToken).ConfigureAwait(false);
            Dictionary<string, object> parameters = new[] { id }.ToParameterList("id");
            string sql = SqlStatements.GetItemById(tableName, SystemProperties.JsonIdProperty, parameters.Keys.First());
            using (operationLock.AcquireLock())
            {
                IList<JObject> results = ExecuteQueryInternal(tableName, sql, parameters);
                return results.FirstOrDefault();
            }
        }
public override async Task < JObject > GetItemAsync ( string tableName , string id , CancellationToken cancellationToken = default ) { Arguments . IsValidTableName ( tableName , true , nameof ( tableName ) ) ; Arguments . IsValidId ( id , nameof ( id ) ) ; await EnsureInitializedAsync ( cancellationToken ) . ConfigureAwait ( false ) ; Dictionary < string , object > parameters = new [ ] { id } . ToParameterList ( " " ) ; string sql = SqlStatements . GetItemById ( tableName , SystemProperties . JsonIdProperty , parameters . Keys . First ( ) ) ; using ( operationLock . AcquireLock ( ) ) { IList < JObject > results = ExecuteQueryInternal ( tableName , sql , parameters ) ; return results . FirstOrDefault ( ) ; } }
Returns a single item by the ID of the item.
Returns a single item by the ID of the item .
A task that returns the item when complete.
A task that returns the item when complete .
tableName
string
The table name holding the item.
The table name holding the item .
id
string
The ID of the item.
The ID of the item .
cancellationToken
CancellationToken
A  to observe.
A to observe .