C# Abstract function with implementation possible?

Viewed 15942

Is there a way to add a virtual function that must be overridden by all inherited classes? So actually the combination of virtual and abstract? I have a situation where each inherited class must do some specific processing before some generic code is executed. Virtual functions doesn't work because they do not ensure the inherited classes override them. And abstract function can't have a default implementation. Currently my workaround is to implement another protected function in the base class which contains the common/generic code and is called in the overridden abstract function

3 Answers
Related