LINQ 的难题:序列中不包含任何元素。
var query =
from row in tbl.AsEnumerable()
let criterion = otherList.First<myClass>(o => o.ID == n)
where criterion !=null
select myFun(row)
private DataRow myFun(DataRow row)
{
row["FieldN"] = "nn1";
return row;
}
if (query.Count() <= 0) return null;
return query.CopyToDataTable();
上面这句LinQ为什么运行的时候提示错误:序列中不包含任何元素。