Unity Auto Registration has moved to GitHub

Since CodePlex is shutting down, I contacted ArtemGovorov and he is fine with me moving this project to a new place.
From now on you can find this project on GitHub:
https://github.com/astaerk/AutoRegistration


Install from Nuget
Add it to your project with nuget: Install-Package UnityAutoRegistration
http://nuget.org/List/Packages/UnityAutoRegistration

Project Description
Unity Auto Registration extends Unity IoC container and provides fluent syntax to configure rules for automatic type registration. Using few code lines you can scan specified assemblies and register all types that satisfy your rules.

Rules for determining whether to include/exclude type/assembly are predicates (Predicate<T>) so you can use lambda syntax to specify them or direct method name. There are a few methods in If helper class (like Implements, DecoratedWith) to cover some common scenarios of type registering.

For example, auto registration configuration using Unity Auto Registration may look like:
            var container = new UnityContainer();

            container
                .ConfigureAutoRegistration()
                .ExcludeAssemblies(a => a.GetName().FullName.Contains("Test"))
                .Include(If.Implements<ILogger>, Then.Register().UsingPerCallMode())
                .Include(If.ImplementsITypeName, Then.Register().WithTypeName())
                .Include(If.Implements<ICustomerRepository>, Then.Register().WithName("Sample"))
                .Include(If.Implements<IOrderRepository>,
                         Then.Register().AsSingleInterfaceOfType().UsingPerCallMode())
                .Include(If.DecoratedWith<LoggerAttribute>,
                         Then.Register()
                                .As<IDisposable>()
                                .WithTypeName()
                                .UsingLifetime<MyLifetimeManager>())
                .Exclude(t => t.Name.Contains("Trace"))
                .ApplyAutoRegistration();

Last edited Sep 21 at 12:40 PM by alderschwede, version 13