There are times when it\'s helpful to check a non-repeatable IEnumerable to see whether or not it\'s empty. LINQ\'s Any doesn\'t work well
IEnumerable
Any
This is not an efficient solution if the enumeration is long, however it is an easy solution:
var list = input.ToList(); if (list.Count != 0) { foreach (var item in list) { ... } }