- Use
Countif you’re using aList, since it knows its size. - Use
Lengthfor anArray - If you just have an
IEnumerableI would use.Any()over.Count()as it will be faster since it stops after checking one item.
Also check out this question: Which method performs better: .Any() vs .Count() > 0?