Azure Mobile Service query doesn't return all the rows

后端 未结 3 460
感动是毒
感动是毒 2020-12-19 09:22

I have a table called NameTable in my Azure Mobile Service. When I make the below mentioned calls in my client app (WP8 app using the Mobile Services SDK):

         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-19 10:16

    By default the service will only return a certain number of rows in each Read operation (50, as you noticed). Since there are quotas for the number of returned bytes in Azure services when they're free (and costs for paid ones), the mobile service has this default.

    You can ask for more rows, using the Take operation. There is, however, a limit on the number of rows which you can ask at any given time (which is 1000). The idea is that you shouldn't ask for all data in a table - it can potentially be a lot - and ask for rows as you need them using the Skip and Take operations.

    var myTable = GetZumoService().GetTable();
    var myList = await myTable.Take(500)
                              .Where(nameInfo => nameInfo.IsTaken == false)
                              .ToListAsync();
    

提交回复
热议问题