首页 新闻 会员 周边

使用AutoMapper 时出现 Mapper not initialized

0
[已解决问题] 解决于 2017-09-06 15:42

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.

BUTTERAPPLE的主页 BUTTERAPPLE | 老鸟四级 | 园豆:3190
提问于:2017-09-06 11:35
< >
分享
最佳答案
0

这个报出来的错误具体是指什么问题?

奖励园豆:5
fcyh | 小虾三级 |园豆:568 | 2017-09-06 11:53

AutoMapper未初始化而使用了Mapper.Map<>,在 Startup 中的ConfigureService 里面注册初始化问题就解决了。

BUTTERAPPLE | 园豆:3190 (老鸟四级) | 2017-09-06 11:55
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册