Using DynamicMap() and ignore null source value

后端 未结 2 1967
無奈伤痛
無奈伤痛 2020-12-31 01:21

I\'m using Mapper.DynamicMap() inside a generic method and would like to, without using .CreateMap(), ignore some any source values that are null.

2条回答
  •  悲&欢浪女
    2020-12-31 01:32

    I solved it with DataMember property in destination type [DataMember(EmitDefaultValue = false)] add this in the destination DTO

提交回复
热议问题