Reputation: 594
I followed this to preserve the static feel of earlier automapper API but now i am not able to understand how should I use ForMember api, to map specific members. Any help is appreciated. Thanks.
Upvotes: 0
Views: 987
Reputation: 25039
ForMember
method stills the same:
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<Source, Dest>().ForMember(dest => dest.Id, opt => opt.Ignore());
});
var mapper = config.CreateMapper();
var destination = mapper.Map<Source, Dest>(new Source());
Upvotes: 1