This is absolutely possible. You need to use explicit interface implementation:
interface IFirst { void SomeMethod(); }
interface ISecond { void SomeMethod(); }
class Implementation : IFirst, ISecond {
void IFirst.SomeMethod() { }
void ISecond.SomeMethod() { }
}
Generally, in many cases I recommend to prefer explicit implementation over implicit one (based on a public method of the same name). The case of method name clash to be resolved demonstrates just one of those benefits.
Practically, this case is not so important. But there is another case where you could have clearly unambiguous syntax which is impossible to express without interfaces — two different indexed property. How to achieve the syntax below?
MyClass myInstance =
myInstance[3] = "first case";
myInstance["key"] = "second case";
How? Here is the solution:
interface IAuxIndexer { string this[int index] { get; set; } }
class MyClass {
string IAuxIndexer.this[int index] { get { } set { } }
public string this[string index] { get { } set { } }
}
This way, to have three different indexed property in one class, you need two interfaces, etc.
—SA