public DepartmentModel UpdateDept(DepartmentModel model)
        {
            //var isExist = _context.Departments.Where(n => n.DeptId == model.DeptId).FirstOrDefault();
            //if (isExist == null) throw new Exception("user not found");

            var deptInDb = _context.Departments.Find(model.DeptId);

            if (deptInDb == null)
            {
                throw new Exception("not found");
            }

            var entity = model.Edit(deptInDb, model);

            _context.Entry(entity);
            _context.SaveChanges();
            return(model);
        }