Ejemplo n.º 1
0
        public void UpdateClosingPrices(IEnumerable <StockPrice> closingPrices)
        {
            var @event = new ClosingPricesAddedEvent(Id, Version, closingPrices.Select(x => new ClosingPricesAddedEvent.ClosingPrice(x.Date, x.Price)));

            Apply(@event);

            PublishEvent(@event);
        }
Ejemplo n.º 2
0
 public void Apply(ClosingPricesAddedEvent @event)
 {
     Version++;
     foreach (var closingPrice in @event.ClosingPrices)
     {
         UpdatePrice(closingPrice.Date, closingPrice.Price);
     }
 }
Ejemplo n.º 3
0
        public void UpdateClosingPrice(Date date, decimal closingPrice)
        {
            var @event = new ClosingPricesAddedEvent(Id, Version, new ClosingPricesAddedEvent.ClosingPrice[] { new ClosingPricesAddedEvent.ClosingPrice(date, closingPrice) });

            Apply(@event);

            PublishEvent(@event);
        }