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