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 |
What is lambda expression in linq c#?
What is linq in c# with example?
Why can not datareader by returned from a web services method?
Explain what is linq?
Which assembly represents the core LINQ API?
Explain Union, Intersect and Except?
When to use Single, SingleOrDefault, First and FirstOrDefault?
Explain what is lambda expressions in linq?
What is difference between IEnumerable and IList?
Why linq is required?
Why do we need linq?
What is linq and 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)