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 |
how LINQ with databases can be used?
Is not supported in linq to entities?
What is linq example?
What is select new linq?
Explain how you can assign a lambda expression to a delegate?
Why is linq useful?
Why is linq required?
How to pass parameters to stored procedure using linq?
What is the purpose of linq?
Can we use linq to query against a datatable?
Why do we need linq?
What are the important points to remember while using lambda expressions?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)