Archives / 2011 / September
  • Autofac - My Choice of IoC Container

    I have been using Unity for dependency injection since the early days of ASP.NET MVC framework. Recently I have evaluated other IoC containers and really impressed with Autofac. The next version of my codeplex project EFMVC will be use Autofac as IoC container.  Autofac is a lightweight IoC container that providing better performance and can easily integrate with .NET applications. Autofac is developed by Nicholas Blumhardt and the community is actively working on the code base.

  • Auto Registration in Microsoft Unity

    Unlike many other .NET IoC containers, Microsoft Unity does not support auto registrations. Auto registration is a very useful feature for any IoC container and it would be very helpful in some specific contexts.  The Unity Auto Registration project in Codeplex will provide the support for automatic registration using a fluent API. You can add Unity Auto Registration package using NuGet. The following command will add reference to Unity Auto Registration.

    PM> Install-Package UnityAutoRegistration

    The following registration syntax will scan the all assemblies except system assemblies and will register all types that implemented the open generic type ICommandHandler<>