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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rajeesh MenothPosted Mar 2, 2016, 12:17 PM
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.
Ravi PatelPosted Mar 2, 2016, 7:34 AM
Amit Kumar SinghPosted Mar 2, 2016, 6:44 AM