public void AddNewDepartment(Department productDeparment) { try { _departmentRepository.Add(productDeparment); //_uow.Save(); } catch (Exception ex) { throw new Exception("Failed adding the department", ex); } }
public void UpdateDepartment(Department department) { try { //ProductCategory category = _categoryRepository.GetAll().FirstOrDefault(i => i.Id == id); //category.DepartmentId = 1; _departmentRepository.Update(department); _uow.Save(); } catch (Exception ex) { throw new Exception("Failed updating the department", ex); } }