public void AlterarEmail(Guid id, string email) { var participante = eventStoreService.LoadAggregate <Participante>(id); participante.AlterarEmail(email); eventStoreService.SaveAggregate(participante); }
public async Task AlterarEmail(Guid id, string email) { var participante = await eventStoreService.LoadAggregate <Participante>(id); participante.AlterarEmail(email); await eventStoreService.SaveAggregate(participante); }
public void Handle(T @event) { if (@event.Version % settings.WhenVersionNumberIsDividedBy != 0) { return; } var aggregate = eventStoreService.LoadAggregate(@event.AggregateId, GetAggregateTypeFromEvent(@event)); var snapshot = BuildSnapshotFromAggregate(aggregate); snapshotStore.SaveSnapshot(snapshot); Console.WriteLine($"{@event.AggregateId} Version: {@event.Version} snapshotted"); }
public Extrato RetornarExtrato(Guid id) { return(eventStoreService.LoadAggregate <Extrato>(id)); }
public async Task <Extrato> RetornarExtrato(Guid id) { return(await eventStoreService.LoadAggregate <Extrato>(id)); }