将 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
请问如何解决?
改为下面的代码解决了
cfg.CreateMap<JobOffer, Document>().ConstructUsing((j, context) =>
{
//...
});