linq判断集合是否为空的方法

Enumerable.Any 扩展方法可以判断集合为空:

如果不为空

if (!source.Any()) { //...
}

 

posted @ 2014-03-03 15:06  ``炯``  阅读(1366)  评论(0编辑  收藏  举报