Accepted answer

your foreach version calls var localenumertaor =; inside the profile action, while the enumerator version calls it outside of the profile call.

on top of that, the first execution of the iterator version will exhaust the items in the enumerator, and on subsequent iterations itemscollection.movenext() will return false and skip the inner loop entirely.

Related Query

More Query from same tag