Last active
August 29, 2015 14:01
-
-
Save lfbarbieri/8c0b12193a758048f749 to your computer and use it in GitHub Desktop.
Creates a Canadian Provinces List.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace MyNameSpace | |
{ | |
public class Provinces | |
{ | |
private static List<Province> _provinceList = new List<Province> () | |
{ | |
new Province() { Abbreviation = "AB", Description = "Alberta"}, | |
new Province() { Abbreviation = "BC", Description = "British Columbia"}, | |
new Province() { Abbreviation = "MB", Description = "Manitoba"}, | |
new Province() { Abbreviation = "NB", Description = "New Brunswick"}, | |
new Province() { Abbreviation = "NL", Description = "Newfoundland and Labrador"}, | |
new Province() { Abbreviation = "NS", Description = "Nova Scotia"}, | |
new Province() { Abbreviation = "NT", Description = "Northwest Territories"}, | |
new Province() { Abbreviation = "NU", Description = "Nunavut"}, | |
new Province() { Abbreviation = "ON", Description = "Ontario"}, | |
new Province() { Abbreviation = "PE", Description = "Prince Edward Island"}, | |
new Province() { Abbreviation = "QC", Description = "Quebec"}, | |
new Province() { Abbreviation = "SK", Description = "Saskatchewan"}, | |
new Province() { Abbreviation = "YT", Description = "Yukon"} | |
}; | |
public static List<Province> ProvinceList | |
{ | |
get { return _provinceList; } | |
} | |
} | |
public class Province | |
{ | |
public string Abbreviation { get; set; } | |
public string Description { get; set; } | |
public Province () { } | |
public override string ToString () | |
{ | |
return Description.ToString (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment