I have a IQueryable which is ordered by some condition.
Now I want to know the position of a particular element in that IQueryable.
Is there a linq expression to get that.
Say for example there are 10 elements in the IQueryable and the 6th element matches a condition, I want to get the number 6.
I have a IQueryable which is ordered by some condition. Now I want to
Share
First select each item with its index, then filter the items, and finally extract the original index:
Test bed:
Output: