Results 1 to 13 of 13
Jul 29, 2010, 10:54 #1
- Join Date
- Jan 2009
- Wiltshire, UK
- 0 Post(s)
- 0 Thread(s)
Dependency Injection and Action Controllers
I'm using a DI container to assemble my application, however one area I'm a little stuck on is action controllers.
Until run time it is impossible to know what dependencies a controller has because each action can have different requirements. The logical solution seems to be treating the DI container a bit like a service locator and just injecting it into the controller. It doesn't really feel right to do this though.
I'd be interested to know how others have handled this and of there's a general consensus on how this should be dealt with.
Best regards, George