First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

unity

There are 1 entries for the tag unity

ASP.NET MVC ControllerFactory for Unity and the reasoning behind it

Most of the mainstream IoC containers have their own implementation of a custom controller factory for ASP.NET MVC, but Unity doesn’t. There is an implementation in the MvcContrib project, but I don’t like the way it works, so I decided to implement it myself. Unity Controller Factory After a few mail exchanges with a guys of the p&p team and with Brad Wilson I came out with the following 35 lines of code. public class UnityControllerFactory: DefaultControllerFactory { protected override IController GetControllerInstance(Type controllerType) { ...