コード例 #1
0
        public IActionResult Edit(int id, Unit unit)
        {
            if (id != unit.UnitId)
            {
                return(NotFound());
            }

            _context.Update(unit);
            _context.SaveChanges();

            return(RedirectToAction(nameof(Index)));
        }
コード例 #2
0
        public IActionResult Edit(int id, Employee employee)
        {
            if (id != employee.EmployeeId)
            {
                return(NotFound());
            }


            _context.Update(employee);
            _context.SaveChanges();

            return(RedirectToAction(nameof(Index)));
        }