You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AdMappingProfile.cs 730B

3 lat temu
12345678910111213141516171819202122232425
  1. 
  2. using System.Diagnostics.CodeAnalysis;
  3. namespace Diligent.WebAPI.Business.MappingProfiles
  4. {
  5. public class AdMappingProfile : Profile
  6. {
  7. [ExcludeFromCodeCoverage]
  8. public AdMappingProfile()
  9. {
  10. #region DTO to Model
  11. CreateMap<AdCreateDto, Ad>();
  12. CreateMap<AdUpdateDto, Ad>();
  13. #endregion
  14. #region Model to DTO
  15. CreateMap<Ad, AdResponseDto>();
  16. CreateMap<Ad, AdDetailsResponseDto>();
  17. CreateMap<Ad, AdApplicantsViewDto>();
  18. CreateMap<Ad, AdResponseWithCountDto>()
  19. .ForMember(dest => dest.Count, opt => opt.MapFrom(x => x.Applicants.Count));
  20. #endregion
  21. }
  22. }
  23. }