public static Customer Create(string name) { var fact = new CustomerCreatedFact() {Name = name, AggregateRootId = Guid.NewGuid()}; var customer = new Customer(); customer.Append(fact); customer.Apply(fact); return customer; }
internal static Appointment HydrateFrom(AppointmentCreatedFact fact, Customer parent) { var appointment = new Appointment(parent); appointment.Apply(fact); return appointment; }