예제 #1
0
        public Order(OrderDescription description)
        {
            // Note how the domain constraints are enforced on construction
            // More specific constraints (such as the contents of OrderDescription) have been enforced on construction of the respective types

            this.Id = IdGenerator.Current.CreateId();

            this.CreationDateTime = Clock.Now;

            this.Description = description ?? throw new ArgumentNullException(nameof(description));

            this.ShippingStatus = new ShippingStatus(this.CreationDateTime, ShippingResult.Unshipped);
        }
예제 #2
0
 public void ChangeDescription(OrderDescription description)
 {
     this.Description = description ?? throw new ArgumentNullException(nameof(description));
 }