Exemplo n.º 1
0
        private void Construct(SeatTypeId id, ConcertId concertId, string name, int quantity, Money price)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("not be null or empty", nameof(name));
            }

            if (quantity <= 0)
            {
                throw new ArgumentException("must be greater than zero", nameof(name));
            }

            Id        = id ?? new SeatTypeId();
            ConcertId = concertId ?? throw new ArgumentNullException(nameof(concertId));
            Name      = name;
            Quantity  = quantity;
            Price     = price ?? throw new ArgumentNullException(nameof(price));
        }
Exemplo n.º 2
0
 public SeatType(SeatTypeId id, ConcertId concertId, string name, int quantity, Money price)
 {
     Construct(id, concertId, name, quantity, price);
 }