Then there is this to inherit from more than one interface:
class EmptyClass : IDoSomething, IDoSomethingElse
{
}
interface IDoSomething
{
}
interface IDoSomethingElse
{
}
static class InterfaceExtensions
{
public static int DoSomething(this IDoSomething tThis)
{
return 8;
}
public static int DoSomethingElse(this IDoSomethingElse tThis)
{
return 4;
}
}
Using extension methods on the interface you can have something more like multiple inheritance than just tacking the interfaces on. Since the Methods are not part of the interface definition, you also don't have to implement them in the class, unless you want to. (Not really overriding them, you need a reference of type EmptyClass to call them since more specific, or exact type name, wins over inherited types.