Is there any way to auto-configue Automapper to scan for all profiles in namespace/assembly? What I would like to do is to add mapping profiles to AutoMapper from given asse
Similar to @Martino's answer, but with a MapperConfiguration object. This will add all profiles from the assembly that contains the type MyProfile.
var config = new MapperConfiguration(cfg => { cfg.AddProfiles(typeof(MyProfile)); }); var mapper = config.CreateMapper();