What is the difference between single and first in linq?
Answer Posted / Santosh Kumar Shukla
In LINQ, Single() returns the first element that matches the query, or throws an exception if there are no elements matching the query. First(), on the other hand, returns the first element or a default value (null for reference types, Default for nullable value types) if no elements match.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category