是否可以将下面的linq查询合并到一个查询中?在linq查询中筛选所选可枚举项
var checkBoxes = from x in FindAll<CheckBox>()
where x.Checked
select new
{
RecordType = Type.GetType(x.Attributes["RecordType"]),
RecordId = Int32.Parse(x.Attributes["RecordId"])
};
checkBoxes = from x in checkBoxes
where x.RecordType != typeof(DomainModel.Group)
select x;
啊。当然:) 感谢您的快速回复! – asgerhallas 2010-08-17 09:16:49
它将在8分钟内被接受。 – asgerhallas 2010-08-17 09:17:08
使用let关键字是个好主意。顺便说一句,我们可以在泛型linq表达式中使用一些方法,如“let”关键字?看到我的答案。 – 2010-08-17 09:20:30