Why do I have to call the .CreateMap method?
Actually its totally obviously that calling the .Map method has the same source/destination parameter.
Is this a typical case “if you dont like the software do not use it”
or is there an easier less cumbersome way to make a mapping in one line I do not know of?
Mapper.CreateMap<ReleaseViewModel, Release>();
Release release = (Release)Mapper.Map(releaseViewModel, typeof(ReleaseViewModel), typeof(Release));
I think you can see the “CreateMap<>” as method to register your mapping with automapper.
The “Map()” is actualy executing the mapping registered.
The “CreateMap<>” has extra methods to fine grain your mapping, which is by itself a reason to seperate those two methods. Think of it as “Seperation of Concern”-principle.
One liner wrapper