[英]Convert LINQ query expression
I have the following code:我有以下代码:
var attr = from a in ClsT.Current.GetValues()
from b in a.SomeMethod()
where typeof(ClsA).SomeOtherMethod(b)
select b;
How can I convert it to => notation?如何将其转换为 => 符号?
This would be这将是
ClsT.Current.GetValues().SelectMany(a => a.SomeMethod())
.Where(b => typeof(ClsA).SomeOtherMethod(b));
The equivalent code would be:等效代码为:
var attr = ClsT.Current.GetValues()
.SelectMany(a => a.SomeMethod())
.Where(b => typeof(ClsA).SomeOtherMethod(b);
Perhaps:也许:
ClsT.Current.GetValues().SomeMethod().Where(b => typeof(ClsA).SomeOtherMethod(b))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.