public async Task <IActionResult> Edit(int id, [Bind("ID,WordText,Translation,Description")] Word word) { if (id != word.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(word); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WordExists(word.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(word)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,ExampleText,ExampleTranslation")] Example example) { if (id != example.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(example); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExampleExists(example.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(example)); }