public EmploymentHistory UpdateEmploymentHistory(EmploymentHistory empHistory) { var emp = appDbContext.employmentHistories.Attach(empHistory); emp.State = Microsoft.EntityFrameworkCore.EntityState.Modified; appDbContext.SaveChanges(); return(empHistory); }
public EmploymentHistory DeleteEmploymentHistory(int id) { EmploymentHistory employment = appDbContext.employmentHistories.Find(id); if (employment != null) { appDbContext.employmentHistories.Remove(employment); appDbContext.SaveChanges(); } return(employment); }
/******************************************************************* * IMPLEMENTING EMPLOYEEHISTORY INTERFACE * ********************************************************************/ public EmploymentHistory AddEmploymentHistory(EmploymentHistory empHistory) { appDbContext.employmentHistories.Add(empHistory); appDbContext.SaveChanges(); return(empHistory); }