Using Entity Framework in .NET I want to loop through a list of items returned from the database and make updates.
var qry = (from c in DBEntities.Customer select c);
foreach (Object item in qry)
{
item.FirstName = ....
... etc, other code here
DBEntities.SaveChanges();
}
According to : http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/8a337036-d288-48d4-80d4-89e5a51eddd9?ppud=4 S Hargroves suggests converting to a IList and that is the solution.
Haven't tried that, I'm sure it will work, but even it works, I want to know why I can't update the item during the loop? This is occuring on my local development environment with no other users hitting the database.
Thanks ...