Beispiel #1
0
 /// <summary>
 ///     Persists the state of the specified aggregate by adding new events to the event store.
 /// </summary>
 /// <param name="aggregate">The aggregate to persist.</param>
 public async Task SaveAsync <TAggregate>(TAggregate aggregate)
     where TAggregate : class, IEventSourced
 {
     aggregates.Add(aggregate);
     await builder.GetRepository <TAggregate>().Save(aggregate);
 }
Beispiel #2
0
 /// <summary>
 ///     Persists the state of the specified aggregate by adding new events to the event store.
 /// </summary>
 /// <param name="aggregate">The aggregate to persist.</param>
 public void Save <TAggregate>(TAggregate aggregate)
     where TAggregate : class, IEventSourced
 {
     aggregates.Add(aggregate);
     builder.GetRepository(aggregate.GetType()).Save(aggregate);
 }
Beispiel #3
0
 public async Task SaveAndMigrateAsync <TAggregate>(TAggregate aggregate, IEnumerable <EventMigrator.Rename> renames)
     where TAggregate : EventSourcedAggregate <TAggregate>
 {
     aggregates.Add(aggregate);
     await EventMigrator.SaveWithRenames((IMigratableEventSourcedRepository <TAggregate>) builder.GetRepository <TAggregate>(), aggregate, renames);
 }