I have a Dictionary whose elements I need to iterate through and make changes. I cannot use foreach statement, since it sometimes throws InvalidOperationException, saying that t
ElementAt is an extension method defined in System.Linq.Enumerable.
You need to add a using clause to make it visible:
using System.Linq;
Note that ElementAt on a Dictionary