I had defined in my project a global Automapper configuration that would allow me to use Mapper.Map
in my code. (See my configu
This is new in AutoMapper 4.2. There is a blog post by Jimmy Bogard on this: Removing the static API from AutoMapper. It claims that
The IMapper interface is a lot lighter, and the underlying type is now just concerned with executing maps, removing a lot of the threading problems...
The new syntax: (pasted from the blog post)
var config = new MapperConfiguration(cfg => {
cfg.CreateMap();
});
If you just want the "old way" of doing this. The latest version 4.2.1 has brought back some tradition. Just use
CreateMap();
instead of
Mapper.CreateMap();
The old code will work just fine.