Polymorphism in C# makes no sense
Let's assume such a case:
And for the Car class I have an error
I could use IEngine instead of Engine in Car, which would fix the error. But then I can't use the methods of the Engine class.
I completely don't understand why I can't use Engine since this class implements IEngine.
I can't have different classes implementing ICar and having inside different classes implementing IEngine, they all have to be on the base IEngine.
This is terribly frustrating.
Instead of using interfaces in such cases, I have to get rid of them.
And for the Car class I have an error
I could use IEngine instead of Engine in Car, which would fix the error. But then I can't use the methods of the Engine class.
I completely don't understand why I can't use Engine since this class implements IEngine.
I can't have different classes implementing ICar and having inside different classes implementing IEngine, they all have to be on the base IEngine.
This is terribly frustrating.
Instead of using interfaces in such cases, I have to get rid of them.