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
I use Bool IsCollectionNullOrEmpty = !(Collection?.Any()??false);. Hope this helps.
Breakdown:
Collection?.Any() will return null if Collection is null, and false if Collection is empty.
Collection?.Any()??false will give us false if Collection is empty, and false if Collection is null.
Complement of that will give us IsEmptyOrNull.