AutoMapper 忽略某个字段

以前要在定义中忽略

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

  

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

特此记录。

原文地址:https://www.cnblogs.com/zinan/p/10629277.html