private void When( ESInv.Messages.OrderRefundMade @event) { ESInv.DBC.Ensure.That(this.Id != Guid.Empty, "Order has NOT already been created"); this.c_entries.Add( new OrderEntry( OrderEntryType.Credit, @event.Value.FromMessage(), DateTimeOffset.Now)); }
public void Mutate( ESInv.Messaging.IEvent @event) { ((dynamic)this).When((dynamic)@event); this.Version++; }
private void When( ESInv.Messages.OrderCreated @event) { ESInv.DBC.Ensure.That(this.Id == Guid.Empty, "Order has already been created"); this.Id = @event.OrderId; this.MerchantId = @event.MerchantId; this.SaleValue = @event.SaleValue.FromMessage(); this.Offers = @event.Offers.Select(offer => offer.FromMessage()); this.CreationTimestamp = @event.Timestamp; this.c_entries = new List<OrderEntry>(); }