日期:2014-05-18 浏览次数:20886 次
List<TestModel> lst1=new List<TestModel>(){new TestModel("1","NAME1"),new TestModel("2","NAME2")}; List<TestModel> lst2 = new List<TestModel>() { new TestModel("2", "NAME2"), new TestModel("3", "NAME3") }; lst2.Where(P=>lst1.Any(o=>o.ID==P.ID)).ToList().ForEach(v=>Console.WriteLine(v.ID+":"+v.NAME));
------解决方案--------------------
没发现你说的问题呢~
------解决方案--------------------
var xxx =(form p1 in results from p2 in Works2 where p1.id==p2.id select p1).ToList();
------解决方案--------------------
var xxx2= Works2.ToList();
这样会报错否
------解决方案--------------------
results = results.OrderBy(p=>p.ID).Where(p => Works2.Exists(p2 => p2.ID == p.ID));