我一直无法找到任何信息将此代码放入我的项目中。现在我在需要映射器的每个操作中都使用它。有没有更好的方法来做到这一点而不依赖注入?
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<Source, Dest>();
});
IMapper iMapper = config.CreateMapper();
var destList= iMapper.Map<Dest[]>(sourceList);
Run Code Online (Sandbox Code Playgroud)