I was looking at my profiler and it seem that the Linq extension method Single selects 2 rows. So why does the Single LINQ extension method create a query Select TOP(2)? Shouldn’t it be select top(1) instead?
I was looking at my profiler and it seem that the Linq extension method
Share
Firstonly requests a single result.Singlerequests two results because it only returns a result if there is exactly one member of the result set. If there are zero or two (or more than two) it throws an exception, so it has to request at least two results.