I\'m trying to create a wrapper for a Dictionary
.
Dictionary
implements IEnumerable
Here's the declaration of IEnumerable:
public interface IEnumerable : IEnumerable
{
new IEnumerator GetEnumerator();
}
notice the new keyword.
Here's the declaration of IEnumerable:
public interface IEnumerable
{
IEnumerator GetEnumerator();
}
So now you have a GetEnumerator method, but which one of those two are you implementing? Therefore, you need to add an explicit implementation of the non-generic version:
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}