![]() ![]() This code could be simplified quite a bit. The only way of knowing for sure that you have received all the records is to do a request and be told there is no more. For example, it may be configured with a maximum transfer size and the records won't fit into the transfer buffer. The OData subsystem is allowed to return less than the requested value and it will do so for a variety of reasons. Why not stop at the second request? We expect this code to run on a live system. ![]() If you have 75 records, three requests will be made - the first will bring down 50 records, the second 25 records and the third no records. This code will always make a minimum of 2 requests if there is any data. Var pageOfItems = await table.Skip(allItems.Count).Take(pageSize).ToListAsync() ![]() In the Services\AzureCloudTable.cs file, replace the ReadAllItemsAsync() method with the following: public async Task> ReadAllItemsAsync() In the class of "probably not what we want", we can keep on reading records until there are no more records to read. There are multiple ways to fix this and it depends on your final expectation. Note that even though there are more than 50 records, you will only see 50 records in the list.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |