2011-08-17 95 views
0

我有以下代码:转换LINQ查询表达式

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

我怎样才能将它转换为=>符号?

+1

没有得到你............ ............... –

+0

请告诉我们您的意思是_“。(点)符号”_ – diceler

+0

它是LINQ-to-SQL。你想将它转换为linq吗? –

回答

1

这将是

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

也许:

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

等效代码如下:

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