How to download AutoMapper from Unity?

I need to use Unity as my DI container and you want to download AutoMapper .

Using StructureMap , I can do it like this:

 For<IMappingEngine>().Use(() => Mapper.Engine); 

How to do it in Unity ?

I used the package manager to get the latest version of AutoMapper 2.2.1-ci9000 currently, but can also use 2.2.0 in case it is easier. I am using version 2.1.505.0 of Microsoft.Practices.Unity .

+7
source share
1 answer

This should work:

 container.RegisterType<IMappingEngine>(new InjectionFactory(_ => Mapper.Engine)); 
+11
source

All Articles