One of my interview questions I dare to ask is “Can you do multiple inheritance in C#?”.
So far, the correct answer always was ‘No’, but with the release of C# 8 the answer became more nuanced. Although a C# class can implement multiple interfaces it can inherit from only one base class. Until C# 8, only the base class could provide code that is usable by the derived class.
With C# 8, interfaces can also provide code to their implementing classes. This allows us to share code without a common base class. Finally we can do a (kind of) multiple inheritance…