Ejemplo n.º 1
0
        public async Task <ActionResult> ChangeMusicInstruments(MusicInstrumentForDropdown musicInstrumentForDropdown)
        {
            MusicInstrumentDTO musicInstrumentDTO = _InstrumentService.GetById(musicInstrumentForDropdown.MusicInstrumentId);
            ICollection <MusicInstrumentDTO> musicInstrumentDTOs = new List <MusicInstrumentDTO>();

            musicInstrumentDTOs.Add(musicInstrumentDTO);
            await _musicianService.AddMusicInstrumentsToMusician(musicInstrumentDTOs, Guid.Parse(User.Identity.GetUserId()));

            return(RedirectToAction("Index", "Home"));
        }
Ejemplo n.º 2
0
        public ActionResult ChangeMusicInstruments()
        {
            var instruments = _InstrumentService.GetAll();
            ICollection <MusicInstrumentViewModel> entity = new List <MusicInstrumentViewModel>();

            foreach (var instrument in instruments)
            {
                entity.Add(_mapper.Map <MusicInstrumentDTO, MusicInstrumentViewModel>(instrument));
            }
            MusicInstrumentForDropdown musicInstrumentForDropdown = new MusicInstrumentForDropdown()
            {
                MusicInstuments = entity
            };

            return(View(musicInstrumentForDropdown));
        }