I was wondering if it is possible to do ranged sort using LINQ, for example i have list of numbers:
List< int > numbers = new List< int >
- 1
- 2
- 3
- 15 <– sort
- 11 <– sort
- 13 <– sort
- 10 <– sort
- 6
- 7
- etc.
Simply using numbers.Skip(3).Take(4).OrderBy(blabla) will work, but it will return a new list containing only those 4 numbers. Is is somehow possible to force LINQ to work on itself without returning a new “partial” list or to receive complete one with sorted part?
Thanks for any answer!
Try something like this: