以前要在定义中忽略

 Mapper.CreateMap<Source, Destination>()
    .ForMember(dest => dest.SomeValuefff, opt => opt.Ignore());

  

一直在找更方便的方法,今天在一篇博客中发现,如果字段是virtual类型的,那么也会被忽略掉。

特此记录。

posted on 2019-03-30 22:02  芝麻的西瓜  阅读(5352)  评论(0编辑  收藏  举报