| 123456789101112131415161718192021222324252627 |
- using Diligent.WebAPI.Contracts.DTOs.User;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace Diligent.WebAPI.Business.MappingProfiles
- {
- public class UserMappingProfile : Profile
- {
- public UserMappingProfile()
- {
- #region DTO to Model
- CreateMap<CreateUserRequestDto, User>();
- #endregion
-
- #region Model to DTO
- CreateMap<User, UserResponseDTO>();
- CreateMap<User, UserDetailsResponseDTO>()
- .ForMember(dest => dest.PhoneNumber, opt => opt.NullSubstitute("User has no phone number saved."))
- .ForMember(dest => dest.Position, opt => opt.NullSubstitute("Position has not been declared yet."))
- .ForMember(dest => dest.SocialMedias, opt => opt.NullSubstitute("User takes no part in any social media."));
- #endregion
- }
- }
- }
|