Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is difference between first and firstordefault in linq?



What is difference between first and firstordefault in linq?..

Answer / Nisha Choudhary

Both First() and FirstOrDefault() are used to get the first element from a sequence, but they behave differently when no elements match the condition. First() throws an exception if no elements match, while FirstOrDefault() returns default value of the sequence's type.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More LINQ Language-Integrated Query Interview Questions

Define different types of linq?

1 Answers  


What is Expression Trees?

1 Answers  


What are disadvantages of LINQ?

1 Answers  


What is linq in xamarin?

1 Answers  


Why do we need linq?

1 Answers  


How are standard query operators implemented in linq?

1 Answers  


Why do we use linq?

1 Answers  


what is the difference between Skip() and SkipWhile() extension method?

1 Answers  


What is the use of System.XML.XLinq.dll?

1 Answers  


How does linq to sql work?

1 Answers  


What is difference between linq and entity framework?

1 Answers  


Why from comes first in linq?

1 Answers  


Categories