例外:
Configuration ='AutoMapper.Mapper.Configuration'引发了'System.InvalidOperationException'类型的异常
代码:
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<CrmMapper.ExamModel, CrmMapper.ExamInventoryModel>()
.ForMember(v => v.ExamId, opts => opts.MapFrom(src => src.ExamId));
});
IMapper mapper = config.CreateMapper();
var source = new ExamModel();
var dest = mapper.Map<ExamModel, ExamInventoryModel> (source);