List<string>resultList=new List<string>();
List<string>allID=new List<string>();
allID.Add("a1");
allID.Add("a2");
allID.Add("a3");
allID.Add("a4");
allID.Add("a5");
allID.Add("a6");
List<string>selectedID=new List<string>();
selectedID.Add("1");
selectedID.Add("3");
selectedID.Add("5");
resultList=(from a in allID where a.Contains(**one of the ID form selectedID**) select a).ToList();
可以告訴我工作版本嗎?Linq條件「其中id =列表<Item> newList」如何實現
喜(BRO/sis誰負反對票),如果你知道答案,這太容易了,可以給我的網址或鏈接或關鍵字搜索谷歌? – william 2013-03-22 02:50:47
澄清:'a1 == 1'或不? – 2013-03-22 02:53:52
你能提供'resultList'的預期結果嗎?你的描述有點模棱兩可。 – mellamokb 2013-03-22 02:57:18