public async Task <IActionResult> Edit(int id, LoanList loanList) { if (id != loanList.loatypeID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(loanList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LoanListExists(loanList.loatypeID)) { return(NotFound()); } throw; } return(RedirectToAction("Index")); } return(View(loanList)); }
public async Task <IActionResult> Edit(int id, [Bind("docId,document")] Documents documents) { if (id != documents.docId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(documents); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DocumentsExists(documents.docId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(documents)); }