public async Task <ActionResult> DeleteTrainAsync(int trainId) { var train = await _trainService.GetTrainAsync(trainId); if (train is null) { return(NotFound()); } await _trainService.DeleteTrainAsync(trainId); return(NoContent()); }