Место общения программистов C#
1710220930
Гость
Я люблю[code]string.IsNullOrEmpty[/code] method. I'd love to have something that would allow the same functionality for IEnumerable. Is there such? Maybe some collection helper class? The reason I am asking is that in [code]if[/code] statements the code looks cluttered if the patter is [code](mylist != null && mylist.Any())[/code]. It would be much cleaner to have [code]Foo.IsAny(myList)[/code].
This post doesn't give that answer: IEnumerable is empty?.
Источник: [url]https://stackoverflow.com/questions/5047349/how-to-check-if-ienumerable-is-null-or-empty[/url]