 <p>Thanks Equiso, I didn't find the question you refered to. So this is an exact duplicate of <a href="http://stackoverflow.com/questions/295593/linq-query-built-in-foreach-loop-always-takes-parameter-value-from-last-iteration">Linq query built in foreach loop always takes parameter value from last iteration</a>.</p>