選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

AdMappingProfile.cs 730B

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