user1706388
user1706388

Reputation: 47

Azure Mobile Service Query top ten results

I want to return the top 10 items in each group of items that I have stored in an Azure Mobile Service table.

IE._qryItemResult = _tblResult
                      .Where(item => item.grouptype == 1)
                      .Take(10)
                      .ToEnumerableAsync();

If I then want the top 10 items with grouptype=2 and so on... do I need to execute another query and append to the initial result or am I missing a cleverer way?

Thanks

Upvotes: 1

Views: 351

Answers (1)

Eoin Campbell
Eoin Campbell

Reputation: 44268

How many entries does your _tblResult contain ? If it's not a significant amount, you could just bring the lot back into memory, and then use linq queries on them there.

But if you have to go out to the service each time, then yes you will need to specify multiple seperate queries, each with their own Where() filter/Take() amount combo.

Upvotes: 1

Related Questions