sdk/dotnet/src/Microsoft.Datasync.Client.SQLiteStore/OfflineSQLiteStore.cs
/// <summary>
/// Returns items from the table.
/// </summary>
/// <param name="query">A query describing the items to be returned.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to observe.</param>
/// <returns>A task that returns a page of items when complete.</returns>
Returns items from the table.
Returns items from the table .
public override async Task<Page<JObject>> GetPageAsync(QueryDescription query, CancellationToken cancellationToken = default)
        {
            Arguments.IsNotNull(query, nameof(query));
            await EnsureInitializedAsync(cancellationToken).ConfigureAwait(false);
            string queryStmt = SqlStatements.SelectFromTable(query, out Dictionary<string, object> parameters);
            using (operationLock.AcquireLock())
            {
                IList<JObject> rows = ExecuteQueryInternal(query.TableName, queryStmt, parameters);
                Page<JObject> result = new() { Items = rows };
                if (query.IncludeTotalCount)
                {
                    string countStmt = SqlStatements.CountFromTable(query, out Dictionary<string, object> countParams);
                    IList<JObject> countRows = ExecuteQueryInternal(query.TableName, countStmt, countParams);
                    result.Count = countRows[0].Value<long>("count");
                }
                return result;
            }
        }
public override async Task < Page < JObject > > GetPageAsync ( QueryDescription query , CancellationToken cancellationToken = default ) { Arguments . IsNotNull ( query , nameof ( query ) ) ; await EnsureInitializedAsync ( cancellationToken ) . ConfigureAwait ( false ) ; string queryStmt = SqlStatements . SelectFromTable ( query , out Dictionary < string , object > parameters ) ; using ( operationLock . AcquireLock ( ) ) { IList < JObject > rows = ExecuteQueryInternal ( query . TableName , queryStmt , parameters ) ; Page < JObject > result = new ( ) { Items = rows } ; if ( query . IncludeTotalCount ) { string countStmt = SqlStatements . CountFromTable ( query , out Dictionary < string , object > countParams ) ; IList < JObject > countRows = ExecuteQueryInternal ( query . TableName , countStmt , countParams ) ; result . Count = countRows [ 0 ] . Value < long > ( " " ) ; } return result ; } }
Returns items from the table.
Returns items from the table .
A task that returns a page of items when complete.
A task that returns a page of items when complete .
query
QueryDescription
A query describing the items to be returned.
A query describing the items to be returned .
cancellationToken
CancellationToken
A  to observe.
A to observe .