I tried to implement IEnumerator< Status > but got errors about two different Properties not being implemented.
‘DataReader’ does not implement
interface member
‘System.Collections.Generic.IEnumerator.Current’‘DataReader’ does not implement
interface member
‘System.Collections.IEnumerator.Current’
The solution that worked was:
public Status Current { get; set; }
object System.Collections.IEnumerator.Current
{
get { throw new NotImplementedException(); }
}
It looks like I could have multiple Properties with the same name separated by different namespaces.
What is this type of “property overloading” called?
And how can I find out more about it.
The second property implementation is an explicit interface implementation. It specifically implements the property
Currentfor theIEnumerableinterface. The reason you need to do this is that theCurrentproperty of your class is not the same type (Statusvsobject), so it doesn’t match what the interface dictates.