When to use Single, SingleOrDefault, First and FirstOrDefault?
Answer / Manoj Kumar Ram
Use Single or SingleOrDefault when you expect only one result and want either an exception thrown (Single) or the default value returned (SingleOrDefault). Use First or FirstOrDefault when you expect more than one result, but need only the first one.
| Is This Answer Correct ? | 0 Yes | 0 No |
When to use Single, SingleOrDefault, First and FirstOrDefault?
What is expression tree in linq?
How to assign a computed value to the same array back?
Why do we need linq?
Explain what is the extension of the file, when LINQ to SQL is used?
What are important features of linq?
What are element operators?
What is the advantage of linq in c#?
What is a linqdatasource control?
Explain why select clause comes after from clause in linq?
Write a program for concat to create one sequence of data rows that contains datatabless data rows, one after the other?
Explain what is select clause and where clause in linq?
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)