Last active
September 26, 2018 22:53
-
-
Save avegaraju/f5c6040682597f7535eba60962a62ea8 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
type Order(selectedPaymentMethod: PaymentMethod, | |
discountCode: Option<string>) = | |
let paymentMethod pm = | |
match pm with | |
| x when x = CashOnDelivery -> | |
printfn "Cash on delivery" | |
| Paypal id-> | |
printf "paid by paypal %A" id | |
| Card (cardNumber , cardType) -> | |
printf "paid by %A%A" cardNumber cardType | |
let printPaymentMethod = paymentMethod (selectedPaymentMethod) | |
//members | |
member val PaymentMethod: PaymentMethod = paymentMethod with get | |
//other members removed for brevity | |
printfn "%A" printPaymentMethod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment