public string PilotReport(string pilotReporting) { IPilot pilot = this.pilots .FirstOrDefault(p => p.Name == pilotReporting); return(pilot.Report()); }
public string PilotReport(string pilotReporting) { IPilot pilot = this.pilots .Where(x => x.Name == pilotReporting) .FirstOrDefault(); return(pilot.Report()); }
public string PilotReport(string pilotReporting) { if (pilots.Any(p => p.Name == pilotReporting)) { IPilot pilot = this.pilots.FirstOrDefault(p => p.Name == pilotReporting); return(pilot.Report()); } return(string.Format(OutputMessages.PilotNotFound, pilotReporting)); }
public string PilotReport(string pilotReporting) { IPilot repot = pilots.FirstOrDefault(x => x.Name == pilotReporting); if (pilots.Contains(repot)) { return(repot.Report()); } return(string.Format(OutputMessages.PilotNotFound, pilotReporting)); }
public string PilotReport(string pilotReporting) {//Additional validation IPilot pilot = this.pilots.FirstOrDefault(p => p.Name == pilotReporting); if (pilot is null) { return(string.Format(OutputMessages.PilotNotFound, pilot)); } return(pilot.Report()); }
public string PilotReport(string pilotReporting) { IPilot pilot = this.pilots.FirstOrDefault(x => x.Name == pilotReporting); if (pilot != null) { return(pilot.Report()); } return(null); //todo }
public string PilotReport(string pilotReporting) { if (this.pilots.ContainsKey(pilotReporting)) { IPilot pilot = this.pilots[pilotReporting]; return(pilot.Report()); } return(string.Empty); // not sure }
public string PilotReport(string pilotReporting) { if (!IsThatPilotExist(pilotReporting)) { return(null); } IPilot pilotToReport = this.pilots[pilotReporting]; return(pilotToReport.Report()); }
public string PilotReport(string pilotReporting) { IPilot pilotToReport = this.pilots.FirstOrDefault(p => p.Name == pilotReporting); if (pilotToReport == null) { return($"Pilot {pilotReporting} could not be found"); } return(pilotToReport.Report()); }
public string PilotReport(string pilotReporting) { IPilot reportingPilot = this.pilots.FirstOrDefault(x => x.Name == pilotReporting); if (reportingPilot != null) { return(reportingPilot.Report()); } return(string.Format(OutputMessages.PilotNotFound, pilotReporting)); }
public string PilotReport(string pilotReporting) { IPilot pilot = null; if (pilots.ContainsKey(pilotReporting)) { pilot = pilots[pilotReporting]; } return(pilot.Report()); }
public string PilotReport(string pilotReporting) { IPilot pilot = this.pilots.FirstOrDefault(x => x.Name == pilotReporting); if (pilot != null) { return($"{pilot.Report()}"); } else { return($"Pilot {pilotReporting} could not be found"); } }
public string PilotReport(string pilotReporting) { IPilot pilot = this.pilots.FirstOrDefault(p => p.Name == pilotReporting); if (pilot == null) { return(string.Format(OutputMessages.PilotNotFound, pilotReporting)); } string result = pilot.Report(); return(result); }
public string PilotReport(string pilotReporting) { IPilot pilot = this.pilots[pilotReporting]; return(pilot.Report()); }