Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

UserMappingProfile.cs 956B

123456789101112131415161718192021222324252627
  1. using Diligent.WebAPI.Contracts.DTOs.User;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace Diligent.WebAPI.Business.MappingProfiles
  8. {
  9. public class UserMappingProfile : Profile
  10. {
  11. public UserMappingProfile()
  12. {
  13. #region DTO to Model
  14. CreateMap<CreateUserRequestDto, User>();
  15. #endregion
  16. #region Model to DTO
  17. CreateMap<User, UserResponseDTO>();
  18. CreateMap<User, UserDetailsResponseDTO>()
  19. .ForMember(dest => dest.PhoneNumber, opt => opt.NullSubstitute("User has no phone number saved."))
  20. .ForMember(dest => dest.Position, opt => opt.NullSubstitute("Position has not been declared yet."))
  21. .ForMember(dest => dest.SocialMedias, opt => opt.NullSubstitute("User takes no part in any social media."));
  22. #endregion
  23. }
  24. }
  25. }