I am trying to set up AutoMapper to convert from Entity to DTO. I know I\'m supposed to be using .ForMember()
after Mapper.CreateMap
a sample implementation would be as follows:
Mapper.CreateMap()
.ForMember(m => m.GameType, opt => opt.MapFrom(src => src.Type))
We need to map this property since the names of the properties of Game and GameViewModel are different - if they are the same and of the same type then it will not need a ForMember
another use of the ForMember is to Ignore Mappings
Mapper.CreateMap()
.ForMember(dest => dest.Prize, opt => opt.Ignore());