protected async Task <bool> DoRegularLoadAsync(bool fullLoad) { int loadCount = IncrementalLoadMax - ReserveSize; ITableQueryAsync <Card> tableQuery = Db.Table <Card>() .Where( c => c.PracticeState == PracticeState.New && !Objects.Select(o => o.Id).Contains(c.Id)) .Take(loadCount); if (!fullLoad) { tableQuery = tableQuery.ShallowLoad(LazyLoader); } tableQuery = Random ? tableQuery.OrderByRand() : tableQuery.OrderBy(c => c.Due); int loadedCount = await AddItemsAsync(tableQuery).ConfigureAwait(false); if (loadedCount < loadCount) { Status = ReviewStatus.MoveNextEndOfStore; } else if (fullLoad) { FurtherLoadedIndex = loadedCount - 1; } return(loadedCount > 0); }
protected async Task <bool> DoRegularLoadAsync(bool fullLoad) { int loadCount = IncrementalLoadMax - ReserveSize; int tomorrow = DateTimeExtensions.Tomorrow.ToUnixTimestamp(); // Prepare query ITableQueryAsync <Card> tableQuery = Db.Table <Card>() .Where( c => c.PracticeState == PracticeState.Due && c.Due < tomorrow && !Objects.Select(o => o.Id).Contains(c.Id)) .Take(loadCount); if (!fullLoad) { tableQuery = tableQuery.ShallowLoad(LazyLoader); } int loadedCount = await AddItemsAsync(tableQuery.OrderBy(c => c.Due)).ConfigureAwait(false); if (loadedCount < loadCount) { Status = ReviewStatus.MoveNextEndOfStore; } else if (fullLoad) { FurtherLoadedIndex = loadedCount - 1; } return(loadedCount > 0); }