Last active
February 18, 2017 20:36
-
-
Save Hallmanac/c01bc463f39f3fea3a189f0c6df1dfed to your computer and use it in GitHub Desktop.
A C# class holding constants for US Counties (a.k.a. parishes or boroughs) that are surfaced as an object called UsCountyDetails. This also references a listing of US States that reside in the Gist here: https://gist.github.com/Hallmanac/00946bfa7e028cee3a313f1c445ba216
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.Collections.Generic; | |
using System.Linq; | |
namespace Hallmanac | |
{ | |
public class UsCounties | |
{ | |
public static UsCountyDetails FlAlachua { get; } = new UsCountyDetails("74227e90-7205-4c22-aab0-590bb06b7057", "Alachua", AllUsStates.Florida, 1); | |
public static UsCountyDetails FlBaker { get; } = new UsCountyDetails("cb491b8d-481b-4970-a1d0-a92f1832511e", "Baker", AllUsStates.Florida, 2); | |
public static UsCountyDetails FlBay { get; } = new UsCountyDetails("5b3be6cb-3f04-49c3-a94b-1f260c2688b0", "Bay", AllUsStates.Florida, 3); | |
public static UsCountyDetails FlBradford { get; } = new UsCountyDetails("5e04f90d-27e6-4c51-a2c1-5ac3b5cf12c6", "Bradford", AllUsStates.Florida, 4); | |
public static UsCountyDetails FlBrevard { get; } = new UsCountyDetails("0bcd7ea2-2a4c-4709-b9b2-2885f3e80550", "Brevard", AllUsStates.Florida, 5); | |
public static UsCountyDetails FlBroward { get; } = new UsCountyDetails("bb7bfd43-7bdc-4c8c-b9e4-8d77eac9ab88", "Broward", AllUsStates.Florida, 6); | |
public static UsCountyDetails FlCalhoun { get; } = new UsCountyDetails("17cb5ff7-d786-4059-b433-4abf8a728518", "Calhoun", AllUsStates.Florida, 7); | |
public static UsCountyDetails FlCharlotte { get; } = new UsCountyDetails("dca52378-3de9-485d-939d-1b23358b8c31", "Charlotte", AllUsStates.Florida, 8); | |
public static UsCountyDetails FlCitrus { get; } = new UsCountyDetails("5c0ddeac-000c-48cc-9ae7-2d153e6a847a", "Citrus", AllUsStates.Florida, 9); | |
public static UsCountyDetails FlClay { get; } = new UsCountyDetails("01ce1f1e-9359-473d-a69a-4e79ae6a6e21", "Clay", AllUsStates.Florida, 10); | |
public static UsCountyDetails FlCollier { get; } = new UsCountyDetails("b517650c-ee9f-44b6-9779-f30ff3ad7556", "Collier", AllUsStates.Florida, 11); | |
public static UsCountyDetails FlColumbia { get; } = new UsCountyDetails("9d0c6db8-b9b7-4924-846a-eb105e632a0a", "Columbia", AllUsStates.Florida, 12); | |
public static UsCountyDetails FlDade { get; } = new UsCountyDetails("7a2718c7-8437-4b0f-8ccf-efef3eadbf22", "Dade", AllUsStates.Florida, 13); | |
public static UsCountyDetails FlDesoto { get; } = new UsCountyDetails("6548b464-a780-4446-b8cc-6c269861c005", "Desoto", AllUsStates.Florida, 14); | |
public static UsCountyDetails FlDixie { get; } = new UsCountyDetails("1c3884e8-639c-4d2f-8a67-00344df4a512", "Dixie", AllUsStates.Florida, 15); | |
public static UsCountyDetails FlDuval { get; } = new UsCountyDetails("3f48da02-9ff5-4614-a254-3d2e1a77048c", "Duval", AllUsStates.Florida, 16); | |
public static UsCountyDetails FlEscambia { get; } = new UsCountyDetails("bacae5f6-cc0b-4bf1-9595-93f38669c926", "Escambia", AllUsStates.Florida, 17); | |
public static UsCountyDetails FlFlagler { get; } = new UsCountyDetails("a8437f30-b437-4f91-9d0d-eef752f2b85b", "Flagler", AllUsStates.Florida, 18); | |
public static UsCountyDetails FlFranklin { get; } = new UsCountyDetails("8928b2b1-5cd7-42b8-9917-489fc0ec9b93", "Franklin", AllUsStates.Florida, 19); | |
public static UsCountyDetails FlGadsden { get; } = new UsCountyDetails("d40b3068-89b5-41e0-8754-7c8198dcfdf6", "Gadsden", AllUsStates.Florida, 20); | |
public static UsCountyDetails FlGilchrist { get; } = new UsCountyDetails("11717d4a-8a36-4707-8a86-37f155f2324a", "Gilchrist", AllUsStates.Florida, 21); | |
public static UsCountyDetails FlGlades { get; } = new UsCountyDetails("07956abb-b711-4202-98e9-5ca81da20002", "Glades", AllUsStates.Florida, 22); | |
public static UsCountyDetails FlGulf { get; } = new UsCountyDetails("d61ff906-4058-4af7-aaba-ba55a937ab9d", "Gulf", AllUsStates.Florida, 23); | |
public static UsCountyDetails FlHamilton { get; } = new UsCountyDetails("e446277d-d5c2-4c61-835c-b4a3f5146436", "Hamilton", AllUsStates.Florida, 24); | |
public static UsCountyDetails FlHardee { get; } = new UsCountyDetails("04bd470b-e5b7-41d7-8a1f-60a311f3e503", "Hardee", AllUsStates.Florida, 25); | |
public static UsCountyDetails FlHendry { get; } = new UsCountyDetails("dfe55201-ccfb-41bb-a6fb-0a6b9d8e7ce0", "Hendry", AllUsStates.Florida, 26); | |
public static UsCountyDetails FlHernando { get; } = new UsCountyDetails("d44045b4-253e-4e21-8298-c1af243c0c3e", "Hernando", AllUsStates.Florida, 27); | |
public static UsCountyDetails FlHighlands { get; } = new UsCountyDetails("a614a8c3-d8d6-4dc3-a21b-d77271a64c09", "Highlands", AllUsStates.Florida, 28); | |
public static UsCountyDetails FlHillsborough { get; } = new UsCountyDetails("8517cbb9-d230-4a4d-9ced-40a3401f6b19", "Hillsborough", AllUsStates.Florida, 29); | |
public static UsCountyDetails FlHolmes { get; } = new UsCountyDetails("bde8029e-abb0-45b6-9a2f-4e683bcbf09e", "Holmes", AllUsStates.Florida, 30); | |
public static UsCountyDetails FlIndian { get; } = new UsCountyDetails("58890067-d1a7-4a7b-bae4-78cb05ea9b6b", "Indian", AllUsStates.Florida, 31); | |
public static UsCountyDetails FlJackson { get; } = new UsCountyDetails("02fe525b-ee85-4a76-bed6-364460221071", "Jackson", AllUsStates.Florida, 32); | |
public static UsCountyDetails FlJefferson { get; } = new UsCountyDetails("5746ce1c-f767-4944-9844-5d9a22dab343", "Jefferson", AllUsStates.Florida, 33); | |
public static UsCountyDetails FlLafayette { get; } = new UsCountyDetails("afff928b-4ef8-424e-816b-419a0bd5a005", "Lafayette", AllUsStates.Florida, 34); | |
public static UsCountyDetails FlLake { get; } = new UsCountyDetails("bf89b1ad-6704-4437-93c1-12d0f54e4261", "Lake", AllUsStates.Florida, 35); | |
public static UsCountyDetails FlLee { get; } = new UsCountyDetails("c363dc17-e1a2-44e2-b541-842f4411f3ac", "Lee", AllUsStates.Florida, 36); | |
public static UsCountyDetails FlLeon { get; } = new UsCountyDetails("bef879a8-dba2-4a58-a918-3a7eb6f77238", "Leon", AllUsStates.Florida, 37); | |
public static UsCountyDetails FlLevy { get; } = new UsCountyDetails("fd98a22c-b4fa-48b8-b1c8-600d5bfb9a09", "Levy", AllUsStates.Florida, 38); | |
public static UsCountyDetails FlLiberty { get; } = new UsCountyDetails("3dd0216f-2239-4fb9-b3c2-0c4c3da11eaf", "Liberty", AllUsStates.Florida, 39); | |
public static UsCountyDetails FlMadison { get; } = new UsCountyDetails("ee4bd433-9056-4d4f-96bd-566dacc64e89", "Madison", AllUsStates.Florida, 40); | |
public static UsCountyDetails FlManatee { get; } = new UsCountyDetails("7951b482-b086-41cb-930c-68cc47397fb1", "Manatee", AllUsStates.Florida, 41); | |
public static UsCountyDetails FlMarion { get; } = new UsCountyDetails("25c8e6c3-7035-4a64-8025-a8af48ecbb77", "Marion", AllUsStates.Florida, 42); | |
public static UsCountyDetails FlMartin { get; } = new UsCountyDetails("d5abd1e9-9d4e-4b76-90ba-0a00774a5414", "Martin", AllUsStates.Florida, 43); | |
public static UsCountyDetails FlMonroe { get; } = new UsCountyDetails("564ca9d0-ac23-491d-9d43-fd075085cdd7", "Monroe", AllUsStates.Florida, 44); | |
public static UsCountyDetails FlNassau { get; } = new UsCountyDetails("bebafcb4-d655-4447-8ef2-0adb80c44e2a", "Nassau", AllUsStates.Florida, 45); | |
public static UsCountyDetails FlOkaloosa { get; } = new UsCountyDetails("5feb0f09-64f3-4b50-b7cb-0d3c1a4e29d7", "Okaloosa", AllUsStates.Florida, 46); | |
public static UsCountyDetails FlOkeechobee { get; } = new UsCountyDetails("2e4c26a1-adbd-4e48-9301-bce4d769d65b", "Okeechobee", AllUsStates.Florida, 47); | |
public static UsCountyDetails FlOrange { get; } = new UsCountyDetails("72cd9516-2a86-4b1d-9e65-12a0ae98e521", "Orange", AllUsStates.Florida, 48); | |
public static UsCountyDetails FlOsceola { get; } = new UsCountyDetails("e0d9688b-550c-4624-8ae7-0064011f7e50", "Osceola", AllUsStates.Florida, 49); | |
public static UsCountyDetails FlPalmBeach { get; } = new UsCountyDetails("9a6970d7-f306-4376-b581-0e5392e43880", "Palm Beach", AllUsStates.Florida, 50); | |
public static UsCountyDetails FlPasco { get; } = new UsCountyDetails("a8f1f354-fabe-46ac-a8c4-78e8c4c688a5", "Pasco", AllUsStates.Florida, 51); | |
public static UsCountyDetails FlPinellas { get; } = new UsCountyDetails("7c9cc234-d9fd-4e38-bf16-c40edfece211", "Pinellas", AllUsStates.Florida, 52); | |
public static UsCountyDetails FlPolk { get; } = new UsCountyDetails("e7286f44-5574-4ff7-a3b5-a7ed65e94235", "Polk", AllUsStates.Florida, 53); | |
public static UsCountyDetails FlPutnam { get; } = new UsCountyDetails("ff4ba2f2-df3c-485b-a3fa-3df4ce4ec02f", "Putnam", AllUsStates.Florida, 54); | |
public static UsCountyDetails FlSantaRosa { get; } = new UsCountyDetails("5089661d-ec03-4100-8341-a69a8b86b632", "Santa Rosa", AllUsStates.Florida, 55); | |
public static UsCountyDetails FlSarasota { get; } = new UsCountyDetails("103bc2cc-2cec-47ca-8794-a633ed635266", "Sarasota", AllUsStates.Florida, 56); | |
public static UsCountyDetails FlSeminole { get; } = new UsCountyDetails("f38cefbe-70d3-435f-bfc4-6e225505d76b", "Seminole", AllUsStates.Florida, 57); | |
public static UsCountyDetails FlStJohns { get; } = new UsCountyDetails("395afc63-6eac-4096-b32b-24e64a73e5a2", "St Johns", AllUsStates.Florida, 58); | |
public static UsCountyDetails FlStLucie { get; } = new UsCountyDetails("93fc61bd-0452-4953-a004-461a8953eb8a", "St Lucie", AllUsStates.Florida, 59); | |
public static UsCountyDetails FlSumter { get; } = new UsCountyDetails("3abee0bc-731b-4f38-a846-588feb164fa9", "Sumter", AllUsStates.Florida, 60); | |
public static UsCountyDetails FlSuwannee { get; } = new UsCountyDetails("2d5e8fa6-86bb-4447-950e-473e7d123f40", "Suwannee", AllUsStates.Florida, 61); | |
public static UsCountyDetails FlTaylor { get; } = new UsCountyDetails("61a298c6-2a0d-4a36-95ed-368d2422023e", "Taylor", AllUsStates.Florida, 62); | |
public static UsCountyDetails FlUnion { get; } = new UsCountyDetails("124426dc-b7ca-4417-9d50-4f1f69a61029", "Union", AllUsStates.Florida, 63); | |
public static UsCountyDetails FlVolusia { get; } = new UsCountyDetails("b81c55dc-b589-42b6-b152-cef00a2bbb76", "Volusia", AllUsStates.Florida, 64); | |
public static UsCountyDetails FlWakulla { get; } = new UsCountyDetails("24e426fa-03fe-4229-b51b-c0ee2080dda5", "Wakulla", AllUsStates.Florida, 65); | |
public static UsCountyDetails FlWalton { get; } = new UsCountyDetails("c5371f6c-2262-4f85-adfa-2df7d2287a3d", "Walton", AllUsStates.Florida, 66); | |
public static UsCountyDetails FlWashington { get; } = new UsCountyDetails("8584db6f-8354-42f3-9580-8d5d7f996724", "Washington", AllUsStates.Florida, 67); | |
public static List<UsCountyDetails> GetAllCounties() | |
{ | |
var county = new UsCounties(); | |
var counties = typeof(UsCounties) | |
.GetProperties() | |
.Where(p => p.CanRead && p.GetGetMethod().IsPublic && (p.GetValue(county) as UsCountyDetails) != null) | |
.Select(p => p.GetValue(county) as UsCountyDetails) | |
.ToList(); | |
return counties; | |
} | |
} | |
} |
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
namespace Hallmanac | |
{ | |
public class UsCountyDetails | |
{ | |
public UsCountyDetails() | |
{ | |
Id = Guid.NewGuid().ToString(); | |
} | |
public UsCountyDetails(string id, string name, UsState state, int indexId = 0 ) | |
{ | |
Id = id; | |
IndexId = indexId; | |
CountyName = name; | |
CountyState = state; | |
} | |
public UsCountyDetails(UsCountyDetails county) | |
{ | |
Id = county.Id; | |
IndexId = county.IndexId; | |
CountyName = county.CountyName; | |
CountyState = county.CountyState; | |
} | |
public int IndexId { get; set; } | |
public string Id { get; set; } | |
public string CountyName { get; set; } | |
public UsState CountyState { get; set; } | |
public string ToFullNameString() => $"{CountyName}, {CountyState}"; | |
public override string ToString() => $"{CountyName}"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment