예제 #1
0
        public CuentaAhorroActor()
        {
            PersistenceId = Context.Parent.Path.Name + "-" + Self.Path.Name;

            Recover <Deposito>(deposito => AgregarDeposito(deposito));

            Recover <SnapshotOffer>(offer =>
            {
                var deposito = offer.Snapshot as Deposito;
                if (deposito != null)
                {
                    Depositos.Add(deposito);
                }
            });

            Command <SaveSnapshotSuccess>(exito => DeleteMessages(exito.Metadata.SequenceNr, false));

            Command <ComandoRealizarDeposito>(cmd => Persist(cmd.Deposito, handler => Handle(cmd.Deposito)));
            Command <RequestConsultarDeposito>(req => Handle(req));
        }
예제 #2
0
 public void RegisterDeposito(Guid depositoID)
 {
     Depositos.Add(depositoID);
 }