public static void DeleteEmployeeDepartmentHistoryEntity(EmployeeDepartmentHistory selectedRecord)
 {
     using (AdventureWorksContext db = new AdventureWorksContext())
     {
         db.Entry(selectedRecord).State = System.Data.Entity.EntityState.Deleted;
         db.SaveChanges();
     }
 }
        public static void EditEmployeeDepartmentHistoryEntity(EmployeeDepartmentHistory employeeDepartmentHistory)
        {
            using (AdventureWorksContext db = new AdventureWorksContext())
            {
                db.Entry(employeeDepartmentHistory).State = System.Data.Entity.EntityState.Modified;
                try
                {
                    db.SaveChanges();

                }
                catch (Exception e)
                {
                    db.Dispose();
                    throw new Exception("Błędne dane obiektu!!");
                }
            }
        }