string[] s = new string[] {"cc", "aa", "bb", "" };
string result = s.FirstOrDefault(x => x.Equals("aa"));
Would one prefer the code above without the .Where() statement or with it?
string[] s = new string[] {"cc", "aa", "bb", "" };
string result = s.Where(x => x.Equals("aa")).FirstOrDefault();
Both forms are equivalent, use the one you prefer. I don’t think it makes a big difference in terms of performance… I tend to chose the first form, because it’s shorter.