Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

AdMappingProfile.cs 656B

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