public static IMapper GetMapper() { List <Type> profiles = new List <Type>(); profiles.AddRange(MapperConfig.GetProfiles()); MapperConfiguration config = new MapperConfiguration(cfg => { foreach (var profile in profiles) { cfg.AddProfile(profile); } }); IMapper mapper = config.CreateMapper(); return(mapper); }
public void SetupMapper() { MapperSetup.RegisterProfiles(MapperConfig.GetProfiles()); }