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

            emp.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            appDbContext.SaveChanges();
            return(empHistory);
        }
Ejemplo 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);
        }
Ejemplo n.º 3
0
 /*******************************************************************
  * IMPLEMENTING EMPLOYEEHISTORY INTERFACE
  * ********************************************************************/
 public EmploymentHistory AddEmploymentHistory(EmploymentHistory empHistory)
 {
     appDbContext.employmentHistories.Add(empHistory);
     appDbContext.SaveChanges();
     return(empHistory);
 }