コード例 #1
0
        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;
        }
コード例 #2
0
 internal static Appointment HydrateFrom(AppointmentCreatedFact fact, Customer parent)
 {
     var appointment = new Appointment(parent);
     appointment.Apply(fact);
     return appointment;
 }