In Visual Studio I can right-click on an interface and choose to Implement Interface, or Implement Interface Explicitly.
public class Test : ITest
{
public string Id // Generated by Implement Interface
{
get { throw new NotImplementedException(); }
}
string ITest.Id // Generated by Implement Interface Explicitly
{
get { throw new NotImplementedException(); }
}
}
The only difference I see between the two is that the Interface name is added to the interface properties and methods when they're created if you choose to Implement Interface Explicitly.
I find it makes the code a bit more readable since I can see where that method/property comes from, however does this make any difference in how the class is used or compiled? And does it really matter if I implement my interfaces implicitly or explicitly?