public async Task <IActionResult> Edit(int id, [Bind("ID,Text,EnterDate,Order")] Note note) { if (id != note.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(note); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NoteExists(note.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(note)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Content,Order")] Sticky sticky) { if (id != sticky.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sticky); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StickyExists(sticky.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sticky)); }