internal void TransferTo(EventSequence eventHistory) { eventHistory.AddRange(this); events.Clear(); startSequenceFrom = eventHistory.Version; version = eventHistory.Version; }
/// <summary> /// Initializes a new instance of the <see cref="EventSourcedAggregate"/> class. /// </summary> /// <param name="id">The id for the new aggregate. If this is not specified, a new <see cref="Guid" /> is created.</param> protected EventSourcedAggregate(Guid?id = null) { this.id = id ?? Guid.NewGuid(); eventHistory = new EventSequence(this.id); pendingEvents = new EventSequence(this.id); }