public void Apply(BankAccountCreated @event) { Id = @event.AccountId; Owner = @event.Owner; Balance = 0; LastModified = @event.Created; }
public BankAccount(string owner, Guid correlationId) { CheckRules(new OwnerNameNotEmptyRule(owner)); BankAccountCreated.Create(correlationId, owner) .Do(Enqueue) .Do(Apply); }
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)); }
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); }
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 }); }
protected virtual void Handle(BankAccountCreated evnt) { _entityManager.BuildAndSave <BankAccountEntity>(evnt); }
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); }
private void Apply(BankAccountDetailsView view, BankAccountCreated @event) { view.Id = @event.AccountId; view.Owner = @event.Owner; }
public async Task On(BankAccountCreated @event, long sequence) { await _repository.RegisterAsync(@event.Id, sequence); _logger.LogInformation($"Bank account {_repository.BankAccount} created."); }
private void Apply(BankAccountShortInfoView view, BankAccountCreated @event) { view.Id = @event.AccountId; view.Owner = @event.Owner; view.Balance = 0; }