public IActionResult UpdateDepartment(int Id, Department department) { var updateDepartmentFromRepo = _repository.GetDepartmentById(Id); if (updateDepartmentFromRepo == null) { return(NotFound()); } _repository.UpdateDepartment(updateDepartmentFromRepo); _repository.SaveChanges(); return(NoContent()); }
public ActionResult <Department> CreateDepartment(Department createDepartment) { _repository.CreateDepartment(createDepartment); _repository.SaveChanges(); return(createDepartment); }