So I'm using the AutoMapper library, and I'm trying to understand how AutoMapper is mapping from the source to the destination property. I think I'm just missing a key part of C#'s expression syntax/Linq support. If anyone could explain to me what exactly is happening here I would appreciate it.
Here is an example of some AutoMapper configuration code:
Mapper.CreateMap<SourceModel, DestinationModel>()
.ForMember(dest => dest.Summary, opt => opt.MapFrom(src => src.Summary))
.ForMember(dest => dest.Year, opt => opt.MapFrom(src => src.Year));
I'm most perplexed by the line dest => dest.Summary
... How exactly is src.Summary
being mapped in to dest.Summary
? How does evaluating the expression dest.Summary
tell AutomMapper to map in to this property? I'm guessing there is some powerful lambda/expression features that I don't understand or am missing.
Thanks!