コード例 #1
0
ファイル: EventSequence.cs プロジェクト: xavierjohn/Its.Cqrs
 internal void TransferTo(EventSequence eventHistory)
 {
     eventHistory.AddRange(this);
     events.Clear();
     startSequenceFrom = eventHistory.Version;
     version           = eventHistory.Version;
 }
コード例 #2
0
 /// <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);
 }