Hi all ,
Please Tell me about singleordefault() and firstordefault() in linq ,How to use please provide example or link
Thanks
Rajveer Singh
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit Kumar SinghRank #562 · 4.3K reputationPosted Mar 2, 2016, 1:44 AM EST
Ravi PatelRank #439 · 5.7K reputationPosted Mar 2, 2016, 2:34 AM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Mar 2, 2016, 7:17 AM EST
The FirstOrDefault() method returns a first specific element of a sequence or default value if that element is not found in the sequence. Whenever FirstOrDefault is used, the query can return any amount of results but you state that you only want the first one.