The result of a query cannot be enumerated more than once

The Solution to The result of a query cannot be enumerated more than once is


Try explicitly enumerating the results by calling ToList().

Change

foreach (var item in query)

to

foreach (var item in query.ToList())

~ Answered on 2011-04-19 22:47:27


Most Viewed Questions: