asg*_*las 1 c# linq-to-objects
是否可以将下面的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;
Run Code Online (Sandbox Code Playgroud)
var checkBoxes = from x in FindAll<CheckBox>()
let recordType = Type.GetType(x.Attributes["RecordType"])
where x.Checked && recordType != typeof(DomainModel.Group)
select new
{
RecordType = recordType,
RecordId = Int32.Parse(x.Attributes["RecordId"])
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
255 次 |
| 最近记录: |