“ExceptionYieldYield” (Solution)
Last updated
Was this helpful?
Last updated
Was this helpful?
Call of evenNumbers.FirstOrDefault()
.
The lines
only build a query, but don't execute it. A logic of the GetSmallNumbers()
method starts run at the first call of the MoveNext()
method, which corresponds to the first call of the MoveNext()
method. At this point, the Exception
will happen.