Exemplo n.º 1
0
 protected void Apply(OfferCreatedEvent @event)
 {
     this.Id = @event.Id;
     _productId = @event.ProductId;
     _term = new Term(@event.DurationInDays);
     _validity = new DateRange(@event.ValidFrom, @event.ValidTo);
     _price = @event.Price;
 }
Exemplo n.º 2
0
 public Offer(Guid id, Guid productId, DateRange validity, Term term, Money price)
     : this()
 {
     base.RaiseEvent(new OfferCreatedEvent
                         {
                             ProductId = productId,
                             DurationInDays = term.DurationInDays,
                             Id = id,
                             ValidFrom = validity.From,
                             ValidTo = validity.To,
                             Price = price
                         });
 }