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

how LINQ with databases can be used?

1 Answers  


Is not supported in linq to entities?

1 Answers  


What is linq example?

1 Answers  


What is select new linq?

1 Answers  


Explain how you can assign a lambda expression to a delegate?

1 Answers  


Why is linq useful?

1 Answers  


Why is linq required?

1 Answers  


How to pass parameters to stored procedure using linq?

1 Answers  


What is the purpose of linq?

1 Answers  


Can we use linq to query against a datatable?

1 Answers  


Why do we need linq?

1 Answers  


What are the important points to remember while using lambda expressions?

1 Answers  


Categories