Chnage the array Airports to List

This commit is contained in:
rebin 2020-01-05 21:51:36 +03:00
Родитель f46e4c6ff9
Коммит 638b533e4e
2 изменённых файлов: 22 добавлений и 15 удалений

Просмотреть файл

@ -42,6 +42,6 @@ namespace FlightFinder.Server.Controllers
}
private string RandomAirline()
=> SampleData.Airlines[new Random().Next(SampleData.Airlines.Length)];
=> SampleData.Airlines[new Random().Next(SampleData.Airlines.Count)];
}
}

Просмотреть файл

@ -1,11 +1,13 @@
using FlightFinder.Shared;
using System.Collections.Generic;
namespace FlightFinder.Server
{
public class SampleData
{
public readonly static Airport[] Airports = new[]
{
public readonly static List<Airport> Airports = new List<Airport>() {
new Airport { Code = "ATL", DisplayName = "Hartsfield–Jackson Atlanta International" },
new Airport { Code = "PEK", DisplayName = "Beijing Capital International" },
new Airport { Code = "DXB", DisplayName = "Dubai International" },
@ -56,20 +58,25 @@ namespace FlightFinder.Server
new Airport { Code = "NRT", DisplayName = "Narita International" },
new Airport { Code = "MSP", DisplayName = "Minneapolis/St Paul International" },
new Airport { Code = "DOH", DisplayName = "Hamad International" },
};
public readonly static string[] Airlines = new[]
public readonly static List<string> Airlines = new List<string>()
{
"American Airlines",
"British Airways",
"Delta",
"Emirates",
"Etihad",
"JetBlue",
"KLM",
"Singapore Airways",
"Qantas",
"Virgin Atlantic",
"American Airlines",
"British Airways",
"Delta",
"Emirates",
"Etihad",
"JetBlue",
"KLM",
"Singapore Airways",
"Qantas",
"Virgin Atlantic",
};
}
}