A Set<T> containing up to element count elements of the source set.
GetRange() copies up to element count elements of the source set,
starting from element 0, to the resulting Set<T>.
As the element order in a Set<T> is not deterministic, GetRange() is often
used in combination with ordering.
This corresponds to a SELECT TOP n in SQL.
GetRange() in server-side OQL only supports retrieving elements from the 0 position of the source set.
In client-side OQL, Set<T>.GetRange()
can also be used to retrieve arbitrary pages of a set. In that case, Genome can fetch all elements up to the
desired page of the set and drop elements that are not needed from the underlying datareader. The client side
behaviour of the GetRange() method can be influenced by using the overload, which requires a
GetRangeMethod argument.
Note that, even when using GetRange(0,1), the result is still a Set<T> with 0 or 1 elements. Use ToObject in order to directly return an instance of the single element contained in the set.
<Type name="Cage">
...
<Member name="TenOldestInhabitants" Oql="Inhabitants.OrderBy([Age descending]).GetRange(0,10)"/>
...
</Type>
Set<T>.GetRange | OqlReference.Chapter26