How many classes can you inherit from in .NET?
There are several backend C# files that I would like to share separate static methods, but they are all in different classes. Is there a way to inherit multiple classes?
Example code would be much appreciated.
C# does not support multiple inheritance (meaning a single class inherits from multiple classes). You can, however, implement multiple interfaces in a single class.
As far as chaining together inherited classes, there isn’t a limit per-se. Just keep in mind the complexity you will introduce to your system. When using inheritance, make sure you are using it in a “is a” scenario. A cheeta is an animal. A mazda is a car. Otherwise, your inheritance tightly couples your classes with a design that becomes much more difficult to maintain.
If they are static “utility” methods, just invoke them directly without inheriting. Unless those methods belong to the entity you are creating, you should not use inheritance.