Last active
August 7, 2020 22:34
-
-
Save ankitvijay/f2cb6ea8414dac1b1056e92690da7fa1 to your computer and use it in GitHub Desktop.
Part 5 - Inheritance Example 2
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 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