So, Image and ImageDTO are 1: 1 ratios. This is a simple mapping using AutoMappper
Mapper.CreateMap<Image, ImageDTO>();
Mapper.CreateMap (); Last Student and StudentDTO, they have a list.
Mapper.CreateMap<Student,StudentDTO> .ForMember(s => s.Images, opt=>opt.MapFrom(p=>p.Images));
Someday, if you try, this is not good for performance. Thanks
source share