C# 0 The Complete Reference


Query Syntax vs. Query Methods



Download 4,07 Mb.
Pdf ko'rish
bet728/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   724   725   726   727   728   729   730   731   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

Query Syntax vs. Query Methods

As the preceding section has explained, C# has two ways of creating queries: the query 

syntax and the query methods. What is interesting, and not readily apparent by simply 

looking at a program’s source code, is that the two approaches are more closely related than 

you might at first assume. The reason is that the query syntax is compiled into calls to the 

query methods. Thus, when you write something like

where x < 10

the compiler translates it into

Where(x => x < 10)

Therefore, the two approaches to creating a query ultimately lead to the same place.

Given that the two approaches are ultimately equivalent, the following question 

naturally arises: Which approach is best for a C# program? The answer: In general, you 

will want to use the query syntax. It is fully integrated into the C# language, supported by 

keywords and syntax, and is cleaner.




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   724   725   726   727   728   729   730   731   ...   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