public async Task <IActionResult> Edit(int id, [Bind("DeckId")] Deck deck) { if (id != deck.DeckId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(deck); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DeckExists(deck.DeckId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(deck)); }
public async Task <IActionResult> Edit(int id, [Bind("CardInfoId,CardId,DbId,Name,Type,Text,Class,CardSet,Img")] CardInfo cardInfo) { if (id != cardInfo.CardInfoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cardInfo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CardInfoExists(cardInfo.CardInfoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cardInfo)); }