日期:2014-05-18  浏览次数:20694 次

LINQ 自定义匿名类型 并取得值后 判断是否为空
var res = from i in t.ItemCats.AsEnumerable()
  select new
  {
  iID = i.Cid,
  iName = i.Name,
  iParentCid = i.ParentCid
  };

怎么判断res 是不是空的

------解决方案--------------------
if(res .Count()>0)
{
//非空
}