111,098
社区成员




var cList = (from c in bList select c.id).Distinct();
foreach (student s in cList.Select(x => aList.Where(y => y.id == x).FirstOrDefault()))
{
Console.WriteLine(s.id + " " + s.name);
}
是这个意思
var cList = (from c in bList select c.id).Distinct();
cList.Select(x => aList.Where(y => y.id == x).FirstOrDefault());
foreach (student s in cList)
{
Console.WriteLine(s.id + " " + s.name);
}
foreach行出错: 错误 1 无法将类型“int”转换为“Test.Program.student”