Here is my code:
var dict = new Dictionary<string, int>();
dict["1"] = 1;
var toDelete = dict.Where(x => true);
foreach (var kvpair in toDelete)
{
dict.Remove(kvpair.Key);
}
I don't see how I'm modifyingtoDelete in my foreach loop...Can anyone explain why this is happening?
Thanks,
-Vivek.