public TvSchedule ConvertToModel(TvScheduleViewModel viewModel)
        {
            var programme = _programmeRepository.Get(viewModel.Programme.Id);

            viewModel.Programme = _mapper.Map <TvProgrammeShortViewModel>(programme);
            var model = _mapper.Map <TvSchedule>(viewModel);

            model.Programme     = programme;
            model.EndAiringTime = viewModel.AiringTime.AddMinutes(viewModel.Programme.Duration);
            return(model);
        }
Beispiel #2
0
        public TvProgrammeCelebrityViewModel PutCelebrityToProgramme(long id)
        {
            var programme = _mapper.Map <TvProgrammeShortViewModel>(_programmeRepository.Get(id));
            var viewModel = new TvProgrammeCelebrityViewModel()
            {
                Programme = programme
            };

            return(viewModel);
        }
Beispiel #3
0
 public TvProgrammeShortViewModel FindViewModel(long id)
 {
     return(_mapper.Map <TvProgrammeShortViewModel>(_programmeRepository.Get(id)));
 }