I'm aware that this question is asked on here a lot, but I'm unable to gather a correct answer based on my specific loop.
I'm using a foreach loop to cycle through a Business Entity like so:
foreach (Content item in category) { item.Stats = 55; item.Commit(); } The foreach loop runs correctly for the first item it retrieves and places the value but breaks shy of the other few and I get the error in my page title. I'm aware that I'm getting the error because the item cannot be modified during iteration. But I'm at a lost as to how else to commit to the database while in this loop.
Thanks in advance.
Commitfunction is modifying the item in some way. Can you post the code to that function?