Esempio n. 1
0
        public EmploymentHistory UpdateEmploymentHistory(EmploymentHistory empHistory)
        {
            var emp = appDbContext.employmentHistories.Attach(empHistory);

            emp.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            appDbContext.SaveChanges();
            return(empHistory);
        }
Esempio n. 2
0
        public EmploymentHistory DeleteEmploymentHistory(int id)
        {
            EmploymentHistory employment = appDbContext.employmentHistories.Find(id);

            if (employment != null)
            {
                appDbContext.employmentHistories.Remove(employment);
                appDbContext.SaveChanges();
            }
            return(employment);
        }
Esempio n. 3
0
 /*******************************************************************
  * IMPLEMENTING EMPLOYEEHISTORY INTERFACE
  * ********************************************************************/
 public EmploymentHistory AddEmploymentHistory(EmploymentHistory empHistory)
 {
     appDbContext.employmentHistories.Add(empHistory);
     appDbContext.SaveChanges();
     return(empHistory);
 }