string[] codes = new string[]{"2008","2009","2010"};string ret = codes.FirstOrDefault<string>(item => item.CompareTo("2009") > 0);為什么執(zhí)行這段代碼會報(bào)異常:Expression cannot contain lambda expressions而改為:string ret = (from c in codes where item.CompareTo("2009") > 0 select c ).FirstOrDefault();就可以執(zhí)行了呢?
Linq問題
阿波羅的戰(zhàn)車
2018-10-24 05:06:44