0

Suppose I have an interface:

interface IFoo
{
    void MyMethod()
    {
        Console.WriteLine("Default implementation here!");
    }
}

Suppose, I have a class that implements IFoo:

class Bar : IFoo
{
    void MyMethod()
    {
        // Need something akin to base.MyMethod() here
        Console.WriteLine("My custom implementation here!");
    }
}

What I want is to first run the default implementation (somewhat alike to base.MyMethod() if IFoo was not an interface but a base class) and then run my custom implementation so that in the end the console output looked like this:

Default implementation here!
My custom implementation here!
cicatrix
  • 163
  • 1
  • 10
  • This might help: https://stackoverflow.com/questions/5976216/how-to-call-an-explicitly-implemented-interface-method-on-the-base-class – sr28 Sep 27 '22 at 10:49

0 Answers0