public void Remove(int id) { var task = _taskManagerRepository.GetById(id); if (task == null) { throw new TaskNotFoundException(id); } _taskManagerRepository.Delete(id); }