From MSDN
It is not possible to access an explicit interface member implementation through its fully qualified name in a method invocation, property access, or indexer access. An explicit interface member implementation can only be accessed through an interface instance, and is in that case referenced simply by its member name.
Because of this, none of the access modifiers like public
, protected
or private
would make any sense.
Note that this won't work:
TestSeparately ts = new TestSeparately();
string id = ts.Id; // compiler error, because Id is not a public property of TestSeparately
You'd need to case it to ITest
:
string id = ((ITest)ts).Id;
So access modifiers are of no use for explicit interface implementations.