public async Task <IActionResult> Edit(int id, [Bind("Id,Gio")] GioKham gioKham) { if (id != gioKham.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gioKham); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GioKhamExists(gioKham.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gioKham)); }
public async Task <IActionResult> Create([Bind("Id,Gio")] GioKham gioKham) { if (ModelState.IsValid) { _context.Add(gioKham); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gioKham)); }