public IActionResult Delete(string id) { var department = _departmentsService.Get(id); if (department == null) { return(NotFound()); } _departmentsService.Remove(department.Id); return(NoContent()); }
public async Task <IActionResult> DeleteConfirmed(int id) { var department = await _departmentsService.FindById(id); if (department == null) { return(NotFound()); } await _departmentsService.Remove(department); return(RedirectToAction(nameof(Index))); }