With the following display:
Mapper.CreateMap<ObjectA, ObjectB>() .ForMember(dest => dest.SomeStringProperty, opt => opt.MapFrom(src => null))
SomeStringProperty now the empty string is not zero (as expected)
This is mistake? How can I get it really null?
I see that opt.Ignore() will make it null, but I really want to make conditional null like the following, and the above simplified error (?) Prevents this
Mapper.CreateMap<ObjectA, ObjectB>() .ForMember(dest => dest.SomeStringProperty, opt => opt.MapFrom(src => src.SomeOtherProp != null ? src.SomeOtherProp.Prop1 : null))
source share