I love string.IsNullOrEmpty method. I\'d love to have something that would allow the same functionality for IEnumerable. Is there such? Maybe some collection he
string.IsNullOrEmpty
I used simple if to check for it
check out my solution
foreach (Pet pet in v.Pets) { if (pet == null) { Console.WriteLine(" No pet");// enumerator is empty break; } Console.WriteLine(" {0}", pet.Name); }