I'm using old version of Castle Windsor - 2.5.1 and ASP.NET MVC. Can I use dependency injection for class other then controllers? I got some services which I'm using in my ASP.NET MVC project and I would like to inject some object to those service in those constructors. Is that possible?
3 Answers
Yes of course you can use this. Inversion of Control is a principle used by frameworks as a way to allow developers to extend the framework or create applications using it. The basic idea is that the framework is aware of the programmer’s objects and makes invocations on them.
Hope this helps.
Comments
Yes, you can use dependency injection any any C# or non C# class. In web, desktop, console app. Anywhere. The same way.
1 Comment
Dawid Rutkowski
I've to check why but it doesn't want to work for not a constructor classes - should work out of the box...