0

I've seen this code in many places but I'm having a hard time understanding what is happening. It works, but it looks redundant to me.

public abstract class BaseController<T> : ControllerBase where T : BaseController<T>

I don't understand where T : BaseController<T>... this looks like a loop.

Jack
  • 5,680
  • 10
  • 49
  • 74
  • is it the syntax `where T: BaseController` that you are trying to understand or the purpose of this ? – Clint Feb 15 '20 at 10:02
  • Take for example `class MyController: BaseController { ... }` You tend to see this pattern when you want to the base controller to be aware of the derived controller. – Nkosi Feb 15 '20 at 11:58

0 Answers0