Exemplo n.º 1
0
        private void Apply(Created e)
        {
            Id = e.AggregateId;

            Name = new CustomerName(e.CustomerName);
            Address = new Address(e.Street, e.StreetNumber, e.PostalCode, e.City);
        }
Exemplo n.º 2
0
 private void Apply(NameChanged e)
 {
     Name = new CustomerName(e.CustomerName);
 }
Exemplo n.º 3
0
 public static Customer CreateNew(CustomerName customerName, Address address)
 {
     return new Customer(customerName, address);
 }
Exemplo n.º 4
0
        public void UpdateName(CustomerName customerName)
        {
            IsClientCreated();

            RaiseEvent(new NameChanged(Id, customerName.Name));
        }
Exemplo n.º 5
0
 private Customer(CustomerName customerName, Address address)
 {
     RaiseEvent(new Created(Guid.NewGuid(), customerName.Name, address.Street, address.StreetNumber, address.PostalCode, address.City));
 }