I have multiple controllers that have some common actions. I have made generic controllers:
public class FirstBaseController<TEntity> where TEntity : class, IFirst, new()
public class SecondBaseController<TEntity> where TEntity : class, ISecond, new()
Then i want to do something like this:
public class MyController : FirstBaseController<First>, SecondBaseController<Second>
And I know that multiple class inheritance is not allowed in C#. Can you tell me alternative way to do this?
The only option is to replace the base classes by interfaces and achieve reuse through composition: