Ejemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Artist,Name,Genre,ReleaseDate,Price,Rank")] Album album)
        {
            if (id != album.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(album);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AlbumExists(album.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(album));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,PhotoName,Url,Date")] MyPhotos myPhotos)
        {
            if (id != myPhotos.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(myPhotos);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    throw;
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(myPhotos));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Email,PhotoName,ShareName")] Shared shared)
        {
            if (id != shared.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shared);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    throw;
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shared));
        }