2011-08-17 94 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);