Looking at the Project Server 2010 SDK (found here in .NET Reflector, I have found something interesting that confuses me.
Apparently, the SvcProject.ProjectClient class in ProjectServerServices.dll inherits from System.ServiceModel.ClientBase<Project>, which is an abstract class that implements the System.IDisposable interface. However, when I inspect the SvcProject.ProjectClient class (which is not abstract), there is no Dispose method. What gives? I thought that every method inherited from interfaces had to be implemented in a concrete implementation (otherwise what’s the use of interfaces). Is .NET Reflector lying to me? Did Microsoft for some reason circumvent this requirement? What’s going on?
It’s probably been implemented explicitly, like this:
Either that or it inherits the method from the base class. Just because
ClientBase<T>is abstract doesn’t mean that it can’t have implementedIDisposableproperly itself. Indeed, it will have to either implemented it or redeclared it as an abstract method to force the derived class to implement it.Either way, the method will be there somehow.
Explicit interface implementation means that the method is only available when the instance is viewed via the interface type. For example: