I have a doubt
If I have two approaches like
int a = (from e in MyIntegerList where e % 2 == 0 select e).FirstOrDefault();
and
int a = MyIntegerList.FirstOrDefault(e => e % 2 == 0);
Which will be more efficent and why?
I heard that FirstOrDefault(with predicate) will not iterate on whole collection and will return first element that matches the condition?
Will that be the case with both statements above or not?