Ejemplo n.º 1
0
 public Task <Result> SaveAsync(EventBuffer <TId> buffer)
 {
     if (buffers.TryGetValue(buffer.AggregateId, out EventBuffer <TId> existing))
     {
         existing.AddRange(buffer.Uncommitted);
         existing.MarkAllAsCommitted();
         buffer.MarkAllAsCommitted();
     }
     else
     {
         buffers.Add(buffer.AggregateId, buffer.MarkAllAsCommitted());
     }
     return(Task.FromResult(Result.OK));
 }
Ejemplo n.º 2
0
 public InMemoryEventStore(EventBuffer <TId> initial)
 {
     buffers.Add(initial.AggregateId, initial.MarkAllAsCommitted());
 }