I was told, that for 1 property<=>1 property mapping I should use MapFrom, but when the destination property is somehow calculated or modified, then I should use ResolveUsing. Still when I use this mapping it still works:
.ForMember(item => item.Validity, record => record.MapFrom(r => new DateInterval(r.Start, r.End)))
Actually I cannot even find any difference in the way the two functions work.
Is there any real difference?
The MapFrom method will do things like null checks etc. that can be done be examining the expression tree. ResolveUsing - you don't really get anything "extra". The idea was MapFrom was from another property, and ResolveUsing, anything you want.
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