In a yield return statement, expression is evaluated and returned as a value to the enumerator object; expression has to be implicitly convertible to the yield type of the iterator.
In a yield break statement, control is unconditionally returned to the caller of the iterator, which is either the IEnumerator..::.MoveNext method (or its generic [T:System.Collections.Generic.IEnumerable'1] counterpart) or the Dispose method of the enumerator object.
The yield statement can only appear inside an iterator block, which can be implemented as the body of a method, operator, or accessor. The body of such methods, operators, or accessors is controlled by the following restrictions:
Unsafe blocks are not allowed.
Parameters to the method, operator, or accessor cannot be ref or out.
A yield return statement cannot be located anywhere inside a try-catch block. It can be located in a try block if the try block is followed by a finally block.
A yield break statement may be located in a try block or a catch block but not a finally block.
A yield statement cannot appear in an anonymous method. For more information, see Anonymous Methods (C# Programming Guide).
When used with expression, a yield return statement cannot appear in a catch block or in a try block that has one or more catch clauses. For more information, see Exception Handling Statements (C# Reference).