Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void RegisterMappings()
- {
- // Doctors - to DTO
- Mapper.CreateMap<Model.Doctor, DTO.Doctor>()
- .ForMember(dest => dest.Patients, opt => opt.Ignore());
- // Doctors - from DTO
- Mapper.CreateMap<DTO.Doctor, Models.Doctor>()
- .ForMember(dest => dest.FullName,
- opt => opt.MapFrom(
- src => src.FirstName + " " + src.LastName)
- );
- }
Add Comment
Please, Sign In to add comment