I need to access the current and previous element in an IQueryable object. If I had an int array, I would do the following:
var array = new int[]{0,1,2,3,4}; for(var i = 1; i<array.Length ; i++) { method1(array[i-1], array[i]); }
I don’t know to do the same with IQueryable, since it does not implement IList.
Using extension methods makes this fairly easy.
Usage: