Mapper.CreateMap<A, B>()
.ForMember(dest => dest.defs, opt => opt.MapFrom(origin => origin.abc));
where defs is array of Def (Def[])
how to map?
Mapper.CreateMap<A, B>()
.ForMember(dest => dest.defs, opt => opt.MapFrom(origin => new[]{ origin.abc }));
destination property is array of Def and so the source requries array of something, that's how automapper understands...
this works!!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With