1.

What is the difference between Single() and First() extension methods in LINQ?

Answer»
Single()First()
Used to RETURN a single specific ELEMENT of a query or a DEFAULT value if no result is found.It is used to return the first element of any query with MULTIPLE values.
Used when exactly one element is expected as a result.Used when there are multiple result expectations but you only NEED the first value.


Discussion

No Comment Found