AirlineCollection 1.1.0
.NET 5.0
.NET Core 3.1
.NET Standard 2.1
.NET Framework 4.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
Install-Package AirlineCollection -Version 1.1.0
dotnet add package AirlineCollection --version 1.1.0
<PackageReference Include="AirlineCollection" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AirlineCollection --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AirlineCollection, 1.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install AirlineCollection as a Cake Addin
#addin nuget:?package=AirlineCollection&version=1.1.0
// Install AirlineCollection as a Cake Tool
#tool nuget:?package=AirlineCollection&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
- Light-weight
- Device-agnostic country data (Alternative to the .NET Framework RegionInfo data)
- Preloaded airline information wtih IATA 2-digit code, ICAO 3-digit code, and names.
- Airline code lookup and normalization
- Convenient static data collection with methods
- Fully customizable instance data collection (to add new data and to remove old data)
- IEnumerable implementation (can be used with LINQ)
- DI-friendly interface
- Unit Tested
- No external library dependencies
- No external calls
Name | Format | Description | Example | Notes |
---|---|---|---|---|
Iata2LetterCode | Alphanumeric(2) | IATA 2-Letter Code | "AA" | Commonly used for flight numbers; Can be recycled from a defunct airline |
Icao3LetterCode | Alphanumeric(3) | ICAO 3-Letter Code | "AAL" | Occasionally used for flight numbers |
Prefix | Numeric(3) | IATA-assigned air waybill prefix | "001" | |
IataName | (string) | Name registered at IATA | "American Airlines Inc." | Not recommended for general use |
IcaoName | (string) | Name registered at ICAO | "American Airlines" | Not recommended for general use |
CallSign | alphanumeric | Identification of an aircraft in air-ground communications | "American" | |
Name | (string) | General name | "American Airlines" | The most commonly used name |
STATIC MEMBERS
Read-only data collection
.Contains(code)
string code = "AA";
bool valid = AirlineCollection.Contains(code); // True
.Contains(code)
string lowerCased = "aa";
bool valid = AirlineCollection.Contains(lowerCased); // True
.Contains(code)
int numericCode = 1;
bool valid = AirlineCollection.Contains(numericCode); // True
.Normalize(code)
string iata2DigitCode = "aa";
string code = AirlineCollection.Normalize(iata2DigitCode); // "AA"
.Normalize(code)
string icao3DigitCode = "aal";
string code = AirlineCollection.Normalize(icao3DigitCode); // "AAL"
.Normalize(code)
int numericCode = 1;
string code = AirlineCollection.Normalize(numericCode); // "001"
.Normalize(code)
string invalidCode = "xyz";
string code = AirlineCollection.Normalize(invalidCode); // null
.Normalize(code)
int numericCode = 99999;
string code = AirlineCollection.Normalize(numericCode); // null
.GetAirline(code)
string code = "AA";
var country = AirlineCollection.GetAirline(code); // { "Iata2LetterCode":"AA", "Icao3LetterCode":"USA", "Prefix":"001", "IataName":"American Airlines Inc.", "IcaoName":"American Airlines", "Callsign":"American Airlines", "Name":"American Airlines" }
.GetCountry(code)
string invalidCode = "XYZ";
var airline = CountryCollection.GetAirline(code); // null
<br />
INSTANCE MEMBERS
Customizable data collection (All instance members can be mocked in unit testing by implementing IAirlineCollection)
[code]
string code = "AA";
var airline = new AirlineCollection()[code]; // { "Iata2LetterCode":"AA", "Icao3LetterCode":"USA", "Prefix":"001", "IataName":"American Airlines Inc.", "IcaoName":"American Airlines", "Callsign":"American Airlines", "Name":"American Airlines" }
.Add(iata2LetterCode, icao3LetterCode, prefix)
.Add(iata2LetterCode, icao3LetterCode, prefix, iataName, icaoName, callSign, name)
var airlines = new AirlineCollection();
airlines.Add("XX", "XXX", "999");
airlines.Add("ZZ", "ZZZ", "000", "ZZ Airline", "ZZ Air LLC", "ZZA", "ZZ Air");
.Remove(code)
var code = "AA";
var airlines = new AirlineCollection();
airlines.Remove(code);
<br />
EXTENSION METHODS
.Contains(code)
string code = "AA";
bool valid = new AirlineCollection().Contains(code); // extension method
.Normalize(code)
string iata2DigitCode = "aa";
string code = new AirlineCollection().Normalize(iata2DigitCode); // extension method
.GetAirline(code)
string code = "AA";
var country = AirlineCollection.GetAirline(code); // extension method
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows |
.NET Core | netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.1 |
.NET Framework | net40 net403 net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETCoreApp 3.1
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
* Added more confirmed airlines
* Passed all unit tests (unchanged)