Esempio n. 1
0
 //Domain-Eventhandlers
 private void Apply(CustomerCreatedEvent @event)
 {
     Id            = @event.AggregateId;
     _customerName = new CustomerName(@event.CustomerName);
     _address      = new Address(@event.Street, @event.StreetNumber, @event.PostalCode, @event.City);
     _phoneNumber  = new PhoneNumber(@event.PhoneNumber);
 }
Esempio n. 2
0
 public static Customer CreateNew(Guid id, CustomerName customerName, Address address, PhoneNumber phoneNumber)
 {
     return(new Customer(id, customerName, address, phoneNumber));
 }
Esempio n. 3
0
 private Customer(Guid id, CustomerName customerName, Address address, PhoneNumber phoneNumber)
 {
     RaiseEvent(new CustomerCreatedEvent(id, customerName.Name, address.Street, address.StreetNumber, address.PostalCode, address.City, phoneNumber.Number));
 }