var item = list.Where(t => somecondition);
I would love to be able to find out the index of the element that was returned, in fact, in my case a
Ofcourse its possible using IEnumerable...
public static class EnumerableExtension { public static int FirstIndexMatch(this IEnumerable items, Func matchCondition) { var index = 0; foreach (var item in items) { if(matchCondition.Invoke(item)) { return index; } index++; } return -1; } }