public string[] GetAllVehicles() { Vehicle[] vehicle = _garage.GetAll(); string[] result = new string[_garage.GetVehicleCount()]; for (int i = 0; i < vehicle.Length; i++) { if (vehicle[i] != null) { result[i] = string.Format("P-plats {0}: {1}", i + 1, vehicle[i]); } } return(result); }
public string[] GetAllSpaces() { Vehicle[] vehicle = _garage.GetAll(); string[] result = new string[vehicle.Length]; for (int i = 0; i < vehicle.Length; i++) { if (vehicle[i] == null) { result[i] = string.Format("P-plats {0} är tom.", i + 1); } else { result[i] = string.Format("P-plats {0}: {1}", i + 1, vehicle[i]); } } return(result); }