private void Apply(Created e) { Id = e.AggregateId; Name = new CustomerName(e.CustomerName); Address = new Address(e.Street, e.StreetNumber, e.PostalCode, e.City); }
public static Customer CreateNew(CustomerName customerName, Address address) { return new Customer(customerName, address); }
private Customer(CustomerName customerName, Address address) { RaiseEvent(new Created(Guid.NewGuid(), customerName.Name, address.Street, address.StreetNumber, address.PostalCode, address.City)); }