public async Task <IActionResult> Edit(int id, [Bind("Id,ImagePath")] Info info) { if (id != info.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(info); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InfoExists(info.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(info)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Img,Price,Weight,Description,RoastLevel,Taste,RoastDate")] Coffee coffee) { if (id != coffee.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(coffee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CoffeeExists(coffee.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(coffee)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,NamaKopi,AsalKopi,JenisKopi,DeskripsiKopi")] Coffee coffee) { if (id != coffee.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(coffee); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CoffeeExists(coffee.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(coffee)); }