Ejemplo n.º 1
0
        public static async Task SaveToJournal <TAggregate>(this GridDomainNode node, TAggregate aggregate) where TAggregate : Aggregate
        {
            var domainEvents = ((IAggregate)aggregate).GetUncommittedEvents()
                               .ToArray();

            await node.SaveToJournal <TAggregate>(aggregate.Id, domainEvents);

            aggregate.ClearUncommitedEvents();
        }
Ejemplo n.º 2
0
 public static async Task SaveToJournal <TAggregate>(this GridDomainNode node, string id, params DomainEvent[] messages)
     where TAggregate : Aggregate
 {
     var name = EntityActorName.New <TAggregate>(id).Name;
     await node.SaveToJournal(name, messages);
 }