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 { [ExcludeFromCodeCoverage] public class UserMappingProfile : Profile { public UserMappingProfile() { #region DTO to Model CreateMap(); CreateMap().ForMember(n => n.PhoneNumber, opt => opt.MapFrom(n => n.Phone)); #endregion #region Model to DTO CreateMap(); CreateMap() .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.LinkedIn, opt => opt.NullSubstitute("User takes no part in any social media.")); #endregion } } }