我可以在LINQ中声明/使用一些变量吗
例如,我可以写下面的LINQ更清晰吗?
var q = from PropertyDescriptor t in TypeDescriptor.GetProperties(instance)
where (t.ComponentType.GetProperty(t.Name) != null)
select t.ComponentType.GetProperty(t.Name);
这里有没有办法不写/调用t.ComponentType.GetProperty(t.Name)
两次?
https://stackoverflow.com/questions/18057090
复制相似问题