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
using System; | |
using ValueObject; | |
namespace ValueObject3 | |
{ | |
public record PlaceOrderCommand(Guid CustomerId, string ProductSku, int Quantity, PlaceOrderCurrency Currency) | |
{ | |
public PlaceOrderCommand(Guid customerId, string productSku) | |
: this(customerId, productSku, 1, PlaceOrderCurrency.Default) { } | |
public PlaceOrderCommand(Guid customerId, string productSku, Currency currency) | |
: this(customerId, productSku, 1, new PlaceOrderCurrency(currency.Symbol)) { } | |
public PlaceOrderCommand(Guid customerId, string productSku, int quantity) | |
: this(customerId, productSku, quantity, PlaceOrderCurrency.Default) { } | |
} | |
public record PlaceOrderCurrency(string Symbol) | |
{ | |
public static PlaceOrderCurrency Default => new("USD"); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment