Hi All
I found that a problem with enums. After running the enum taks performer. I had an enum like this:
public enum PaymentType : int
{
Takeon__unknown = -1,
Cash_Received = 1,
Cheque = 2,
Postal_Order = 3,
Credit_Card = 4,
Debit_Cheque_Account = 7,
Debit_Credit_Card = 8,
Bill_Me_Later = 9,
Voucher_Copies = 10,
Complimentary = 13,
Journal = 14,
Direct_Deposit_ABSA = 16,
Split_Deposit_Nedbank = 17,
Direct_Deposit_NedBank = 18,
Direct_Deposit_FTFW = 19,
Auto_Renewal = 20,
Ican_Online_Payment = 21
}
But yet C# allows me to do the following - without raising an exception
PaymentType PType;
PType = (PaymentType)100;
...Strongly typed language? Notice that 100 is not in the enum.
If there is some way to stop this from happening - please let me know. Some type of compiler directive that will raise an exception?