score:4
As you already stated in your question, the Skip method is not implemented in Windows Azure Table storage. This means you have 2 options left:
Option 1
Download all data from table storage (by using ToList, see abatishchev's answer) and execute the Skip and Take methods on this complete list. In your question you're talking about 500 records. If the number of records doesn't grow too much this solution should be OK for you, just make sure that all records have the same partition key.
If the data grows you can still use this approach, but I suggest you evaluate a caching solution to store all the records instead of loading them from table storage over and over again (this will improve the performance, but don't expect this to work with very large amounts of data). Caching is possible in Windows Azure using:
Option 2
The CloudTableQuery class allows you to query for data, but more important to receive a continuation token to build a paging implementation. This allows you to detect if you can query for more data, the pagination example on Scott's blogpost (see nemensv's comment) uses this.
For more information on continuation tokens I suggest you take a look at Jim's blogpost: Azure@home Part 7: Asynchronous Table Storage Pagination. By using continuation tokens you only download the data for the current page meaning it will also work correctly even if you have millions of records. But you have to know the downside of using continuation tokens:
- This won't work with the Skip method out of the box, so it might not be a solution for you.
- No page 'numbers', because you only know if there's more data (not how much)
- No way to count all records
score:0
If paging is not supported by the underlying engine, the only way to implement it is to load all the data into memory and then perform paging:
var list = cityService.Get("0001I").ToList(); // meterialize
var result = list.Skip(x).Take(y);
score:-1
Try something like this:
cityService.Get("0001I").ToList().Skip(n).Take(100);
This should return records 201-300:
cityService.Get("0001I").ToList().Skip(200).Take(100);
score:-1
a.AsEnumerable().Skip(m).Take(n)
Source: stackoverflow.com
Related Articles
- Can I use LINQ to skip a collection and just return 100 records?
- This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type
- LINQ sum collection of items to return object with results (multiple columns)
- How to understand the following C# linq code of implementing the algorithm to return all combinations of k elements from n
- LINQ WHERE method alters source collection
- Return best fit item from collection in C# 3.5 in just a line or two
- Return an empty collection when Linq where returns nothing
- Can I use a collection initializer with LINQ to return a fully populated collection?
- Return Type for Collection from LINQ Query
- LINQ Source Code Available
- Linq to return records that don't have a follow up record
- LINQ to EF - Find records where string property of a child collection at least partially matches all records in a list of strings
- Linq intersect or join to return items from one collection that have matching properties to another?
- How do I delete records from a child collection in LINQ to SQL?
- Linq return all records from entity where a field contains one or more words from a list
- Using a linq or lambda expression in C# return a collection plus a single value
- Linq Query Return List of Records instead of displaying single record
- creating Linq to sqlite dbml from DbLinq source code
- Linq code doesn't return correct record
- How can I use LINQ to just return one row from a selection?
- Do LINQ operations return collections with the same indexes as collection being operated on?
- LINQ return records where string[] values match Comma Delimited String Field
- Using LINQ to return just two specific DataTables in a DataSet with several DataTables
- Linq to Entities left join return 0 records
- LINQ which return Dictionary<string, List<Item>> from collection C#
- Linq to Entity Framework return a list of parents with only a subset or empty collection of children
- Is it possible to perform Linq to return a collection as a HashSet instead of a List?
- C# Linq to find a record that matches a condition, if that record is found return all related records
- How return distinct records using LINQ
- Entity Framework & Oracle, Linq where clause string comparisons do not return any records if given a function parameter rather than a literal
- Reading inner list only with LinqToXml
- Selecting least common item from an enum
- linq select from database where ID in an ArrayList
- Linq Result into Observable collection throws parsing exception
- Linq list of lists to single list
- How do I ensure a sequence has a certain length?
- Entity Framework 6 vs Dapper vs stored procedure vs request in SQL Server
- Select set of results (filter) using composite key ASP.NET Web API
- C# linq increment variable inside anonymous select
- Combining 2 linq queries - group and join
- How to parse deeply nested using LINQ to XML
- Why does this CollectionAssert.AreEquivalent() test fail?
- How to write LINQ query for getting object from another object using C#?
- Casting an IEnumerable<TEntity> to an IEnumerable<TResult> while ensuring deferred execution
- How to get columns from the excel generated using EPPLUS
- how to assign value to entity got from database
- Loop through two XElements based on Condition
- Bitwise operation with grouping using Linq
- How to use FirstOrDefaultAsync() in async await WEB API's
- Using Linq count function with vb.net datatable