将 AutoMapper 由 7.0 升级至 8.0 后,下面的代码
cfg.CreateMap<JobOffer, Document>().ConstructUsing(j =>
{
//...
});
Build 时报错
A lambda expression with a statement body cannot be converted to an expression tree
请问如何解决?
1 回答

30秒到达战场
TA贡献1828条经验 获得超6个赞
改为下面的代码解决了
cfg.CreateMap<JobOffer, Document>().ConstructUsing((j, context) =>
{
//...
});
- 1 回答
- 0 关注
- 569 浏览
添加回答
举报
0/150
提交
取消