Unitiy IOC
Basically, with Unity, I ended up writing something like this (simplified version) :
IUnityContainer container = new UnityContainer(); container.RegisterType<IRiskRepository, RiskRepository>(); string conn = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; container.Configure<InjectedMembers>().ConfigureInjectionFor<RiskRepository>(new InjectionConstructor(conn)); UnityControllerFactory factory = new UnityControllerFactory(container); ControllerBuilder.Current.SetControllerFactory(factory);
Unity turned out to work very well. I was able to save a lot of lines of code and it is greatly improving the testability of the dynamic modules I am using on the mock project architecture. Also, it was easy to set up. Its a good alternative to the other more popular IOC.
