Programming Tips 💡
51.6K subscribers
67 photos
10 videos
30 files
354 links
Programming & AI:
Tips 💡
Articles 📕
Resources 👾
Design Patterns 💎
Software Principles

🇳🇱 Contact: @MoienTajik

🎯 Buy ads: https://telega.io/c/ProgrammingTip
Download Telegram
AutoMapper 6.2.0 Released

A couple of big features in this release include inline maps, where AutoMapper no longer requires you to call CreateMap for new maps.

To configure an inline map, use the mapping options 🤙🏻 :

var source = new Source();

var dest = Mapper.Map<Source, Dest>(source, opt => opt.ConfigureMap().ForMember(dest => dest.Value, m => m.MapFrom(src => src.Value + 10)));


You can use local functions to make the configuration a little easier to read 🤓 :

var source = new Source();

void ConfigureMap(IMappingOperationOptions<Source, Dest> opt) {
opt.ConfigureMap()
.ForMember(dest => dest.Value, m => m.MapFrom(src => src.Value + 10))
};

var dest = Mapper.Map<Source, Dest>(source, ConfigureMap);



https://t.me/pgimg/54

[ Release Notes ] : http://bit.do/atmp


#AutoMapper #CSharp
@ProgrammingTip