已经配置了map,并已依赖注入cfg.CreateMap<User, MentionUserDto>();使用 _mapper.Map<IEnumerable<MentionUserDto>>() 正常,但使用 .ProjectTo<MentionUserDto>(_mapper) 总是提示下面的错误:Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the static Mapper.Map methods, and if you're using ProjectTo or UseAsDataSource extension methods, make sure you pass in the appropriate IConfigurationProvider instance.
at AutoMapper.Mapper.get_Configuration()
- 1 回答
- 0 关注
- 948 浏览
添加回答
举报
0/150
提交
取消