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; }
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 }); }
public Subscription(Guid productId, DateRange dates) { _productId = productId; _dates = dates; }