public ActionResult Edit(Employee employee) { EmployeeContext employeeContext = new EmployeeContext(); employeeContext.Entry(employee).State = System.Data.Entity.EntityState.Modified; employeeContext.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult DeleteConfirmed(int id) { EmployeeContext employeeContext = new EmployeeContext(); Employee employee = employeeContext.Employees.Find(id); employeeContext.Employees.Remove(employee); employeeContext.SaveChanges(); return RedirectToAction("Index"); }
public ActionResult Create(Employee employee) { EmployeeContext employeeContext = new EmployeeContext(); employeeContext.Employees.Add(employee); employeeContext.SaveChanges(); return RedirectToAction("Index"); }