Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active August 7, 2020 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitvijay/f2cb6ea8414dac1b1056e92690da7fa1 to your computer and use it in GitHub Desktop.
Save ankitvijay/f2cb6ea8414dac1b1056e92690da7fa1 to your computer and use it in GitHub Desktop.
Part 5 - Inheritance Example 2
public abstract class StatesPaymentType : PaymentType
{
public new static readonly PaymentType DebitCard = new DebitCardType();
public new static readonly PaymentType CreditCard = new CreditCardType();
public static readonly PaymentType Bitcoin = new BitCoinType();
private class BitCoinType : PaymentType
{
public BitCoinType() : base(3, "Bitcoin")
{
}
public override string Code => "BT";
}
protected StatesPaymentType(int value, string name = null) : base(value, name)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment