Пример #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);
        }
Пример #2
0
 public static Customer CreateNew(CustomerName customerName, Address address)
 {
     return new Customer(customerName, address);
 }
Пример #3
0
 private Customer(CustomerName customerName, Address address)
 {
     RaiseEvent(new Created(Guid.NewGuid(), customerName.Name, address.Street, address.StreetNumber, address.PostalCode, address.City));
 }