Hello,
I'm using RiaServices to populate a grid using an EntityQuery.
Since my database has millions of rows, I want to query only the current page, but also to bring the total number of rows for paging purposes.
Ex: 100 rows total
entityQuery.Skip(0).Take(10); //for the first page
entityQuery.IncludeTotalCount = true;
That brings me 10 rows, and loadOperation.TotalEntityCount = 100. Perfect.
But imagine this:
Ex: 100 rows total
entityQuery.Where(p => Id >= 1 && p.Id <= 50).Skip(0).Take(10); //with filter now
entityQuery.IncludeTotalCount = true;
That brings me 10 rows, and loadOperation.TotalEntityCount = 100 (I need 50!)
Here is the problem: for paging purposes, I need the total number of entities satisfying my filter, not all of them.
Is it possible to change the query for "IncludeTotalCount" or should I forget about TotalEntityCount and query the server two times?
Cheers,
André Carlucci