if (obj is IList)
{
isNullOrEmpty = ((IList)obj).Count > 0 ? false : true;
}
本文介绍了一种检查C#中IList实例是否为空的方法。通过Count属性来判断列表是否包含元素,从而确定其是否为空。
if (obj is IList)
{
isNullOrEmpty = ((IList)obj).Count > 0 ? false : true;
}

被折叠的 条评论
为什么被折叠?