Late last year I was working with Graeme Foster on a project which used ASP.NET MVC. We wanted the code base to be somewhat testable so when we built our controllers we were thinking about using some kind of dependency injection framework. Eventually, given the number of controllers we actually needed we decided that manual constructor injection would be the easiest way to go and just create a custom ControllerFactory.
This evening I’m reading through some of my feeds and I noticed this episode of .NET Rocks with Nicholas Blumhardt on the topic of Autofac. Just looking at the API it looks nice and tidy and minimal (which is what I want from my IoC container technology).
The cool thing is, it seems like it comes with a built in ControllerFactory. I haven’t used Autofac, but I think I will give it a shot next time I need a container.
P.S. The reason it triggered as I was reading my feeds is that I remember Graeme Foster saying that using Lambda expressions to initialise types in a container would be cool. Looks like Autofac supports something like this.