[ad_1]
The Best answer would be that List has some kind of Tracking over its list items and can update its items as you ask but a simple IEnumerable does not so it will not allow you to change them.
[ad_2]
solved Why can’t you modify a collection in a for each loop