0

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.

Ilya Chumakov
  • 23,161
  • 9
  • 86
  • 114
shwetaOnStack
  • 594
  • 4
  • 13

1 Answers1

1

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());
Ilya Chumakov
  • 23,161
  • 9
  • 86
  • 114