public void DeleteDepartmemtById(int deptId)
        {
            var dept = _context.Departments.FirstOrDefault(d => d.Id == deptId);

            if (dept != null)
            {
                _context.Remove(dept);
                _context.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public void DeleteEmployeeById(int employeeId)
        {
            var employee = _context.Employees.FirstOrDefault(e => e.Id == employeeId);

            if (employee != null)
            {
                _context.Remove(employee);
                _context.SaveChanges();
            }
        }