public IActionResult UpdateDepartment(int Id, Department department)
        {
            var updateDepartmentFromRepo = _repository.GetDepartmentById(Id);

            if (updateDepartmentFromRepo == null)
            {
                return(NotFound());
            }
            _repository.UpdateDepartment(updateDepartmentFromRepo);
            _repository.SaveChanges();
            return(NoContent());
        }
Beispiel #2
0
 public ActionResult <Department> CreateDepartment(Department createDepartment)
 {
     _repository.CreateDepartment(createDepartment);
     _repository.SaveChanges();
     return(createDepartment);
 }