繁体   English   中英

转换 LINQ 查询表达式

[英]Convert LINQ query expression

我有以下代码:

var attr = from a in ClsT.Current.GetValues()  
                   from b in a.SomeMethod()  
                   where typeof(ClsA).SomeOtherMethod(b)  
                   select b;

如何将其转换为 => 符号?

这将是

ClsT.Current.GetValues().SelectMany(a => a.SomeMethod())
                        .Where(b => typeof(ClsA).SomeOtherMethod(b));

等效代码为:

var attr = ClsT.Current.GetValues()
           .SelectMany(a => a.SomeMethod())
           .Where(b => typeof(ClsA).SomeOtherMethod(b);

也许:

ClsT.Current.GetValues().SomeMethod().Where(b => typeof(ClsA).SomeOtherMethod(b))

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM