This project is read-only.

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:

Install from Nuget
Add it to your project with nuget: Install-Package 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();

                .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"))
                .Exclude(t => t.Name.Contains("Trace"))

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