You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to enable handling of large sets, it would be better to use an IEnumerable<T> for queries, and pull results by paging. The general idea can be seen in the following code snippet we have used before at Milyli:
varinitialResultSet= repo.Query(query, pageLength);foreach(var result in initialResultSet.Results)yieldreturnresult;stringqueryToken= initialResultSet.QueryToken;// Iterate though all remaining pagesvartotalCount= initialResultSet.TotalCount;intcurrentPosition=pageLength+1;while(currentPosition <= totalCount){varsubsetResult= repo.QuerySubset(queryToken, currentPosition, pageLength);foreach(var result in subsetResult.Results)yieldreturnresult;currentPosition+=pageLength;}
The paging could be set as a global configuration and/or on the specific call, and fallback to "no paging" if not set.
The text was updated successfully, but these errors were encountered:
Very clean, very useful -- necessary, I should say.
Since I am on the direct-SQL calls wave right now (under #24), this Paging will be well handled by SQL server too, so same method signatures will remain and you will be able to do this as easily (and much more quickly) via a SQL-based implementation, soon.
Currently, RsapiDao.GetRDOs(Condition) returns a
List<T>
and pulls all items down at once.In order to enable handling of large sets, it would be better to use an
IEnumerable<T>
for queries, and pull results by paging. The general idea can be seen in the following code snippet we have used before at Milyli:The paging could be set as a global configuration and/or on the specific call, and fallback to "no paging" if not set.
The text was updated successfully, but these errors were encountered: