Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("PlaylistId,PlaylistCreator,PlaylistName")] UserPlaylist userPlaylist)
        {
            if (id != userPlaylist.PlaylistId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userPlaylist);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserPlaylistExists(userPlaylist.PlaylistId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(userPlaylist));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Userid,FirstName,LastName,DisplayName,Gender,Age,Bio,UserAccountId")] UserProfile userProfile)
        {
            if (id != userProfile.Userid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(userProfile);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserProfileExists(userProfile.Userid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Browse)));
            }
            return(View(userProfile));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("TrackId,Name,ArtistName,GenreName,AlbumName,ReleaseYear,Uploader,UploadDate,FileLocation")] SongInfo songInfo)
        {
            if (id != songInfo.TrackId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(songInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SongInfoExists(songInfo.TrackId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(songInfo));
        }