Esempio n. 1
0
 public void Apply(BankAccountCreated @event)
 {
     Id           = @event.AccountId;
     Owner        = @event.Owner;
     Balance      = 0;
     LastModified = @event.Created;
 }
Esempio n. 2
0
        public BankAccount(string owner, Guid correlationId)
        {
            CheckRules(new OwnerNameNotEmptyRule(owner));

            BankAccountCreated.Create(correlationId, owner)
            .Do(Enqueue)
            .Do(Apply);
        }
Esempio n. 3
0
        public BankAccount Build()
        {
            var bankAccountCreated = new BankAccountCreated(id.Value, accountHolderId.Value, iban.Value, accountCurrency.Value, employeeId.Value, 1);

            events.Insert(0, bankAccountCreated);

            return(BankAccount.Rehydrate(id, events));
        }
Esempio n. 4
0
 public void ApplyEvent(BankAccountCreated @event)
 {
     Id         = @event.AggregateRootId;
     UserId     = @event.UserId;
     Iban       = @event.Iban;
     Currency   = @event.Currency;
     Balance    = @event.Balance;
     CreateDate = @event.CreateDate;
 }
 private void Apply(BankAccountCreated bankAccountCreated)
 {
     Id          = bankAccountCreated.Id;
     ClearingNo  = bankAccountCreated.ClearingNo;
     CustomerId  = bankAccountCreated.CustomerId;
     Fullname    = bankAccountCreated.Fullname;
     Address     = bankAccountCreated.Address;
     Phonenumber = bankAccountCreated.Phonenumber;
     Timestamp   = bankAccountCreated.Timestamp;
 }
 private void Handle(BankAccountCreated evnt)
 {
     _connection.Insert(
         new
         {
             Id = evnt.Id,
             AccountNumber = evnt.AccountNumber,
             Customer = evnt.Customer,
             Balance = 0
         },
         "EventSourcing_Sample_BankAccount", _transaction);
 }
Esempio n. 7
0
 internal static Domain.ReadModels.BankAccount ToReadModel(this BankAccountCreated bankAccountCreated)
 {
     return(new Domain.ReadModels.BankAccount
     {
         Id = bankAccountCreated.Id.ToString(),
         ClearingNo = bankAccountCreated.ClearingNo.ToString(),
         AccountNo = bankAccountCreated.AccountNo,
         Address = bankAccountCreated.Address,
         Fullname = bankAccountCreated.Fullname,
         Phonenumber = bankAccountCreated.Phonenumber,
         CustomerId = bankAccountCreated.CustomerId,
         Timestamp = bankAccountCreated.Timestamp,
         Amount = 0,
         IsClosed = false
     });
 }
Esempio n. 8
0
 protected virtual void Handle(BankAccountCreated evnt)
 {
     _entityManager.BuildAndSave <BankAccountEntity>(evnt);
 }
Esempio n. 9
0
 void IApply <BankAccountCreated> .Apply(BankAccountCreated @event)
 {
     iban     = Iban.Of(@event.Iban);
     currency = Currency.Of(@event.Currency);
 }
 protected virtual void Handle(BankAccountCreated evnt)
 {
     _entityManager.BuildAndSave<BankAccountEntity>(evnt);
 }
Esempio n. 11
0
 private void Apply(BankAccountDetailsView view, BankAccountCreated @event)
 {
     view.Id    = @event.AccountId;
     view.Owner = @event.Owner;
 }
Esempio n. 12
0
        public async Task On(BankAccountCreated @event, long sequence)
        {
            await _repository.RegisterAsync(@event.Id, sequence);

            _logger.LogInformation($"Bank account {_repository.BankAccount} created.");
        }
Esempio n. 13
0
 private void Apply(BankAccountShortInfoView view, BankAccountCreated @event)
 {
     view.Id      = @event.AccountId;
     view.Owner   = @event.Owner;
     view.Balance = 0;
 }