コード例 #1
0
        void IOrginator.SetMemento(IMemento memento)
        {
            var clientMemento = (ClientMemento)memento;

            Id           = clientMemento.Id;
            Version      = clientMemento.Version;
            _clientName  = new ClientName(clientMemento.ClientName);
            _address     = new Address(clientMemento.Street, clientMemento.StreetNumber, clientMemento.PostalCode, clientMemento.City);
            _phoneNumber = new PhoneNumber(clientMemento.PhoneNumber);
            _accounts.AddRange(clientMemento.Accounts);

            clientMemento.BankCardMementos.ForEach(x =>
            {
                var bankCard = new BankCard();
                ((IOrginator)bankCard).SetMemento(x);
                _bankCards.Add(bankCard);
            });
        }
コード例 #2
0
        public void UpdateClientName(ClientName clientName)
        {
            IsClientCreated();

            Apply(new ClientNameChangedEvent(clientName.Name));
        }
コード例 #3
0
 public static Client CreateNew(ClientName clientName, Address address, PhoneNumber phoneNumber)
 {
     return(new Client(clientName, address, phoneNumber));
 }
コード例 #4
0
 private Client(ClientName clientName, Address address, PhoneNumber phoneNumber) : this()
 {
     Apply(new ClientCreatedEvent(Guid.NewGuid(), clientName.Name, address.Street, address.StreetNumber, address.PostalCode, address.City, phoneNumber.Number));
 }
コード例 #5
0
 private void onClientNameWasChanged(ClientNameChangedEvent clientNameChangedEvent)
 {
     _clientName = new ClientName(clientNameChangedEvent.ClientName);
 }
コード例 #6
0
ファイル: Client.cs プロジェクト: togakangaroo/Fohjin
        void IOrginator.SetMemento(IMemento memento)
        {
            var clientMemento = (ClientMemento) memento;
            Id = clientMemento.Id;
            Version = clientMemento.Version;
            _clientName = new ClientName(clientMemento.ClientName);
            _address = new Address(clientMemento.Street, clientMemento.StreetNumber, clientMemento.PostalCode, clientMemento.City);
            _phoneNumber = new PhoneNumber(clientMemento.PhoneNumber);
            _accounts.AddRange(clientMemento.Accounts);

            clientMemento.BankCardMementos.ForEach(x =>
            {
                var bankCard = new BankCard();
                ((IOrginator)bankCard).SetMemento(x);
                _bankCards.Add(bankCard);
            });
        }
コード例 #7
0
ファイル: Client.cs プロジェクト: togakangaroo/Fohjin
 public static Client CreateNew(ClientName clientName, Address address, PhoneNumber phoneNumber)
 {
     return new Client(clientName, address, phoneNumber);
 }
コード例 #8
0
ファイル: Client.cs プロジェクト: togakangaroo/Fohjin
 private Client(ClientName clientName, Address address, PhoneNumber phoneNumber)
     : this()
 {
     Apply(new ClientCreatedEvent(Guid.NewGuid(), clientName.Name, address.Street, address.StreetNumber, address.PostalCode, address.City, phoneNumber.Number));
 }
コード例 #9
0
ファイル: Client.cs プロジェクト: togakangaroo/Fohjin
 private void onNewClientCreated(ClientCreatedEvent clientCreatedEvent)
 {
     Id = clientCreatedEvent.ClientId;
     _clientName = new ClientName(clientCreatedEvent.ClientName);
     _address = new Address(clientCreatedEvent.Street, clientCreatedEvent.StreetNumber, clientCreatedEvent.PostalCode, clientCreatedEvent.City);
     _phoneNumber = new PhoneNumber(clientCreatedEvent.PhoneNumber);
 }
コード例 #10
0
ファイル: Client.cs プロジェクト: togakangaroo/Fohjin
 private void onClientNameWasChanged(ClientNameChangedEvent clientNameChangedEvent)
 {
     _clientName = new ClientName(clientNameChangedEvent.ClientName);
 }
コード例 #11
0
ファイル: Client.cs プロジェクト: togakangaroo/Fohjin
        public void UpdateClientName(ClientName clientName)
        {
            IsClientCreated();

            Apply(new ClientNameChangedEvent(clientName.Name));
        }