[Solved] Can’t modify List inside an IEnumerable? [duplicate]
[ad_1] Yes you can’t! The IEnumerable generates new Lists every time it is evaluated; it says so right there in your code: .Select(x => new List<int>{x}); When you call Dump(), it is evaluated. When you call First(), it’s evaluated again. Then Dump again. All new Lists! If you evaluate the IEnumerable before putting it in … Read more