我有以下代码:转换LINQ查询表达式
var attr = from a in ClsT.Current.GetValues()
from b in a.SomeMethod()
where typeof(ClsA).SomeOtherMethod(b)
select b;
我怎样才能将它转换为=>符号?
我有以下代码:转换LINQ查询表达式
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));
也许:
ClsT.Current.GetValues().SomeMethod().Where(b => typeof(ClsA).SomeOtherMethod(b))
等效代码如下:
var attr = ClsT.Current.GetValues()
.SelectMany(a => a.SomeMethod())
.Where(b => typeof(ClsA).SomeOtherMethod(b);
没有得到你............ ............... –
请告诉我们您的意思是_“。(点)符号”_ – diceler
它是LINQ-to-SQL。你想将它转换为linq吗? –