AirlineCollection 1.2.0

dotnet add package AirlineCollection --version 1.2.0                
NuGet\Install-Package AirlineCollection -Version 1.2.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AirlineCollection" Version="1.2.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AirlineCollection --version 1.2.0                
#r "nuget: AirlineCollection, 1.2.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. 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.2.0

// Install AirlineCollection as a Cake Tool
#tool nuget:?package=AirlineCollection&version=1.2.0                
  • 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 Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
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.

Version Downloads Last updated
1.2.0 3,617 12/5/2021
1.1.0 307 12/2/2021
1.0.0 3,504 11/25/2021 1.0.0 is deprecated because it is no longer maintained and has critical bugs.

* Added more confirmed airlines
* Passed all unit tests (unchanged)