Showing posts with label What is the difference between First() and Single() extension methods in LINQ. Show all posts
Showing posts with label What is the difference between First() and Single() extension methods in LINQ. Show all posts

Friday 30 March 2012

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

First() - There is at least one result, an exception is thrown if no result is returned. 

Single() - There is exactly 1 result, no more, no less, an exception is thrown if no result is returned.