Alright, so a way with getting around with multiple-inheritance in C# is through the use of interfaces. Though this is a fair solution, it still requires you to always retype the methods within an interface that aren’t really supposed to change between the classes.
For example, if I have a method .foo() as part of the interface Adabo that is always found to do the same thing (say, it loops 10 times), but at some point of development I find out that I need to make a change to it (say, it is actually supposed to loop 11 times), I’ll have to go through each class that inherits from Adabo and change their own .foo() accordingly.
The only thing I want with interfaces is their free pass at multiple-inheritance, frankly. I’m not really interested in their all-abstract premise. Is there a way to get around this?
Without context, this is a difficult question to answer. Depending on the context, different solutions will be more appropriate than others.
Firstly, as noted elsewhere – interfaces do not specify implementation, they specify only a contract. The implementation will be contained in some base class. A class can implement many interfaces, but the real question you have (I believe) is; “how can I implement many interfaces in a C# class whilst limiting code duplication, given that multiple inheritance is not possible?”.
There are many options, and the context is important. However, some general principles which you could research further;
class carclass could comprise several wheels, an engine, doors, etc. And the wheel class could be reused on aclass BusIEnumerablecan use LINQ methods without actually directly implementing anything.As I stated, context is important, and without it, these are just general pointers that might serve you in some further research.