public void DeleteEmployeeInfo (Employee Entities) { using(var context = new WorkScheduleDBContext()) { var existingvalue = context.Employees.Find(Entities.EmployeeID); context.Employees.Remove(existingvalue); context.SaveChanges(); } }
public void UpdateEmployeeInfo(Employee Entities) { using (var context = new WorkScheduleDBContext()) { var updating = context.Employees.Attach(Entities); var matchingWithExistingValues = context.Entry<Employee>(updating); matchingWithExistingValues.State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void AddEmployeeInfo (Employee Entities) { using(var context = new WorkScheduleDBContext()) { var adding = context.Employees.Add(Entities); context.SaveChanges(); } }