日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
LINQ查詢結(jié)果分析

本文向大家介紹LINQ查詢結(jié)果,可能好多人還不了解LINQ查詢結(jié)果,沒有關(guān)系,看完本文你肯定有不少收獲,希望本文能教會你更多東西。

使用LINQ查詢結(jié)果

如果查詢結(jié)果是強類型的,如string[],List等,就可以不用var類型,而是使用合適的 IEnumerable或IEnumerable(因為IEnumerable也擴展了IEnumerable)類型。

 
 
 
  1. class Program  
  2. {  
  3. static void Main(string[] args)  
  4. {  
  5. Console.WriteLine("***** LINQ Transformations *****"n");  
  6. IEnumerable subset = GetStringSubset();  
  7. foreach (string item in subset)  
  8. {  
  9. Console.WriteLine(item);  
  10. }  
  11. Console.ReadLine();  
  12. }  
  13. static IEnumerable GetStringSubset()  
  14. {  
  15. string[] currentVideoGames = {"Morrowind", "BioShock",  
  16. "Half Life 2: Episode 1", "The Darkness",  
  17. "Daxter", "System Shock 2"};  
  18. // Note subset is an IEnumerable compatible object.  
  19. IEnumerable subset = from g in currentVideoGames  
  20. where g.Length > 6  
  21. orderby g  
  22. select g;  
  23. return subset;  
  24. }  

使用LINQ查詢結(jié)果的分頁處理:

 
 
 
  1. var custTotalOrders = from c in db.D_WorkCenter  
  2. //join o in db.Orders  
  3. //on c.CustomerID equals o.CustomerID into custOrders  
  4. //from o in custOrders  
  5. select new  
  6. {  
  7. WorkCenterID = c.WorkCenterID,  
  8. WorkCenterName = c.WorkCenterName  
  9. //OrderTotal = o.Order_Details.Sum(d => d.UnitPrice * d.Quantity)  

【編輯推薦】

  1. Linq to SQL學(xué)習(xí)經(jīng)驗
  2. Linq隱式類型化局部變量
  3. Linq匿名類型簡單概述
  4. Linq Lambda表達式剖析
  5. Linq對象初始值淺談

新聞標(biāo)題:LINQ查詢結(jié)果分析
地址分享:http://m.5511xx.com/article/cdeepog.html