internal static Appointment Create(DateTimeOffset dateOfAppointment, IAppendFacts parent) { var fact = new AppointmentCreatedFact() {Id = Guid.NewGuid(), DateOfAppointment = dateOfAppointment}; var appointment = new Appointment(parent); appointment.Append(fact); appointment.Apply(fact); return appointment; }
internal static Appointment HydrateFrom(AppointmentCreatedFact fact, Customer parent) { var appointment = new Appointment(parent); appointment.Apply(fact); return appointment; }
public void Apply(AppointmentCreatedFact fact) { Id = fact.Id; DateOfAppointment = fact.DateOfAppointment; }
public void Apply(AppointmentCreatedFact fact) { var appointment = Appointment.HydrateFrom(fact, this); _appointments.Add(appointment); }