Why doesn't LINQ work as expected?
<p>I have created a simple program to calculate primes as follows:</p>

<pre><code>        var db = new HighScoreEntities();
        List&lt;Int64&gt; primes = new List&lt;Int64&gt;(){1};
        for (Int64 x = 2; x &lt; Int64.MaxValue; x++)
        {
            if (primes.FirstOrDefault(y=&gt; x%y == 0) == 0){
                primes.Add(x);
                db.Primes.AddObject(Prime.CreatePrime(x));
                db.SaveChanges();
            }
        }
</code></pre>

<p>My issue is that <code>y</code> is coming out with 225 on the first go through and what seems like random numbers afterwards. Why isn't it iterating through the 'primes' list? I also tried using the Exists function with the same result.</p>
