Пример #1
0
        public async Task <IActionResult> AddSongItem([FromQuery(Name = "playlistID")] string playlistID, [FromQuery(Name = "songName")] string songID)
        {
            PlaylistItem playlistItem = new PlaylistItem
            {
                PlaylistId = Int16.Parse(playlistID),
                SongId     = Int16.Parse(songID)
            };

            bool result = await repo.CreatePlayListItem(playlistItem);

            if (result)
            {
                //return View("Index");
                return(RedirectToAction("Index"));
            }
            else
            {
                ViewData["Error"] = "There was an Error";
            }
            return(View("Index"));
        }