コード例 #1
0
 public void UpdateBuyer(BuyerName buyerName)
 {
     Apply(new BuyerEvents.BuyerUpdated
     {
         BuyerId   = BuyerId,
         BuyerName = buyerName
     });
 }
コード例 #2
0
 public Buyer(BuyerId BuyerId, BuyerName buyerName)
 {
     Apply(new BuyerEvents.BuyerCreated
     {
         BuyerId   = BuyerId,
         BuyerName = buyerName
     });
 }
コード例 #3
0
        protected override void When(object @event)
        {
            switch (@event)
            {
            case BuyerEvents.BuyerCreated e:
                BuyerId   = new BuyerId(e.BuyerId);
                BuyerName = new BuyerName(e.BuyerName);
                break;

            case BuyerEvents.BuyerUpdated e:
                BuyerName = new BuyerName(e.BuyerName);
                break;
            }
        }