Why prefer Yield over a simple return?
<p>I am trying to understand use of Yield to enumerate the collection. I have written this basic code:</p>

<pre><code>static void Main(string[] args)
{
    Iterate iterate = new Iterate();
    foreach (int i in iterate.EnumerateList())
    {
        Console.Write("{0}", i);
    }
    Console.ReadLine();
}

class Iterate
{
    public IEnumerable&lt;int&gt; EnumerateList()
    {
        List&lt;int&gt; lstNumbers = new List&lt;int&gt;();

        lstNumbers.Add(1);
        lstNumbers.Add(2);
        lstNumbers.Add(3);
        lstNumbers.Add(4);
        lstNumbers.Add(5);

        foreach (int i in lstNumbers)
        {
            yield return i;
        }
    }
}
</code></pre>

<p>(1) What if I use simply <code>return i</code> instead of <code>yield return i</code>? </p>

<p>(2) What are the advantages of using Yield and when to prefer using it?</p>

<p><em><strong></em> Edited **</strong></p>

<p>In the above code, I think it is an overhead to use <code>foreach</code> two times. First in the <code>main function</code> and the second in the <code>EnumerateList</code> method.</p>
