public async Task <IActionResult> Edit(int id, [Bind("BlogID,Date,Cmt")] Blog blog) { if (id != blog.BlogID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(blog); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BlogExists(blog.BlogID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(blog)); }
public async Task <IActionResult> Edit(int id, [Bind("PortfolioID,Img,Link,Tech,Cmt")] Portfolio portfolio) { if (id != portfolio.PortfolioID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(portfolio); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PortfolioExists(portfolio.PortfolioID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(portfolio)); }