Example #1
0
        public ActionResult Song(int id)
        {
            SongDTO       songDto = songService.Get(id);
            SongViewModel song    = Mapper.Map <SongDTO, SongViewModel>(songDto);

            ViewBag.PerformerName = performerService.Get(song.PerformerId).Name;
            IEnumerable <ChordDTO>       chordDtos = chordService.GetAllBySongId(id);
            IEnumerable <ChordViewModel> chords    = Mapper.Map <IEnumerable <ChordDTO>, IEnumerable <ChordViewModel> >(chordDtos);

            song.Chords = chords;
            return(View(song));
        }