C# 0 The Complete Reference


from  statement uses  how



Download 4,07 Mb.
Pdf ko'rish
bet721/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   717   718   719   720   721   722   723   724   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

from

 statement uses 



how

 to range over the 



travelTypes

 array. 


Recall that 

travelTypes

 contains an array of the general travel classifications: air, land, and 

sea. The 

join

 clause joins each travel type with those transports that use that type. For 

example, the type Land is joined with Bicycle, Car, and Train. However, because of the 

into

clause, for each travel type, the 



join

 produces a list of the transports that use that travel 

type. This list is represented by 

lst

. Finally, 



select

 returns an anonymous type that encapsulates 

each value of 

how

 (the travel type) with a list of transports. This is why the two 



foreach

loops shown here are needed to display the results of the query:

foreach(var t in byHow) {

  Console.WriteLine("{0} transportation includes:", t.How);

  foreach(var m in t.Tlist)

    Console.WriteLine("  " + m.Name);

  Console.WriteLine();

}

www.freepdf-books.com




574

 

P a r t   I :  



T h e   C #   L a n g u a g e

The outer loop obtains an object that contains the name of the travel type and the list of the 

transports for that type. The inner loop displays the individual transports.


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   717   718   719   720   721   722   723   724   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish