title: When NOT to use yield (return)
body: <blockquote>
    <p><strong>This question already has an answer here:</strong><br>
    <a href="https://stackoverflow.com/questions/3856625/is-there-ever-a-reason-to-not-use-yield-return-when-returning-an-ienumerable">Is there ever a reason to not use &#39;yield return&#39; when returning an IEnumerable?</a>  </p>
  </blockquote>
  
  
  
  <p>There are several useful questions here on SO about the benefits of <code>yield return</code>. For example,</p>
  
  <ul>
  <li><p><a href="https://stackoverflow.com/questions/1330489/can-someone-demystify-the-yield-keyword">Can someone demystify the yield
  keyword</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/1971053/interesting-use-of-the-c-yield-keyword-in-nerd-dinner-tutorial">Interesting use of the c# yield<br>
  keyword</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/39476/what-is-the-yield-keyword-used-for-in-c">What is the yield keyword</a></p></li>
  </ul>
  
  <p>I'm looking for thoughts on when <strong>NOT</strong> to use <code>yield return</code>.  For example, if I expect to need to return all items in a collection, it doesn't <em>seem</em> like <code>yield</code> would be useful, right?  </p>
  
  <p><strong>What are the cases where use of <code>yield</code> will be limiting, unnecessary, get me into trouble, or otherwise should be avoided?</strong></p>