Skip to content
Isaac Abraham edited this page Jan 26, 2016 · 8 revisions

The Unity Automapper has a very simple API surface. To automatically map the types in your project: -

  1. Download the nuget package for Unity Automapper.
Install-Package Lydian.Unity.Automapper
  1. Add a single using statement and call the AutomapAssemblies() extension method on the container, providing the names of the assemblies to map.
using Lydian.Unity.Automapper;
var container = new UnityContainer();
container.AutomapAssemblies("MyFirstAssembly", "MySecondAssembly");

That's it! The automapper will interrogate those assemblies, find matching interface / concrete type implementations, wire them up and register them into Unity.