Esempio n. 1
0
 public IActionResult Create(Employee employee)
 {
     if (ModelState.IsValid)
     {
         if (employee.EmployeeID > 0)
         {
             _employeeContext.Update(employee);
         }
         else
         {
             _employeeContext.CreateEmployee(employee);
         }
         return(RedirectToAction("Index", "Home"));
     }
     else
     {
         return(View(employee));
     }
 }
 public bool Update(Employee entity)
 {
     return _employeeContext.Update(entity);
 }