-
-
Save juanplopes/823834 to your computer and use it in GitHub Desktop.
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
public struct MyEnum | |
{ | |
public static readonly MyEnum Value1 = new MyEnum("value1"); | |
public static readonly MyEnum Value2 = new MyEnum("value2"); | |
readonly string name; | |
MyEnum(string name) : this() | |
{ | |
this.name = name; | |
} | |
} |
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
public struct Country | |
{ | |
public static readonly Country US = new Country("US", "United States", "USD"); | |
public static readonly Country GB = new Country("GB", "Great Britain", "GBP"); | |
public string CountryCode { get; private set; } | |
public string Description { get; private set; } | |
public string Currency { get; private set; } | |
Country(string countryCode, string description, string currency) : this() | |
{ | |
CountryCode = countryCode; | |
Description = description; | |
Currency = currency; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment