Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,AnzahlBlatt,Hersteller,Produkt,Langen,Duft")] Klopapier klopapier)
        {
            if (id != klopapier.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(klopapier);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KlopapierExists(klopapier.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(klopapier));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Hersteller,Vertieb,Genre,Titel,Preis,Veröffentlicht,Beschreibung")] Games games)
        {
            if (id != games.Id)
            {
                return(NotFound());
            }

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