I’ve read about this operator on a book but being that I don’t use databases that much, I cannot think of any circunstance where I’d want to get a single item. I mean, I can have a set of conditions, but then I’d use First or Last, not Single. What is the difference? What is the point of having it return just a single item, and throwing an exception if there are no results or more than one? Only thing that comes to my mind would be to make sure there is really just one item.
Thanks!
This is exactly why you’d want that. Sometimes, having more than one item in the result set indicates a bug somewhere and you’d like an exception to be thrown if that is not the case.