For example to only select a number that is larger than the previous one. I don't currently know of any LINQ method that would allow me to do such a thing
Actually there is a LINQ extension which allows you to do that. the Where
extension has an overload that uses the item value and the item's index:
returnList<int> collectiontest1 = new List<int>()
{
23,
45,
16,
8,
90,
25
};
var test2 = test1.Where((x, i) => (i > 0)?x > collection[itest1[i - 1]:false);
One caveat to this is, it will only work for indexed collections of types that support comparison operators.