public async Task ExecuteAsync(DeletePilotCommand command) { var pilot = await _pilotRepository.GetById(command.PilotId); if (pilot == null) { throw new Exception("Pilot with this Id does not exist"); } await _pilotRepository.Delete(pilot.Id); }
public void DeletePilotById(int id) { pilotRepo.Delete(id); }