Skip to content

Instantly share code, notes, and snippets.

@lfbarbieri
Last active August 29, 2015 14:01
Show Gist options
  • Save lfbarbieri/8c0b12193a758048f749 to your computer and use it in GitHub Desktop.
Save lfbarbieri/8c0b12193a758048f749 to your computer and use it in GitHub Desktop.
Creates a Canadian Provinces List.
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