예제 #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
 public void Apply(CustomerCreatedFact fact)
 {
     Id = fact.AggregateRootId;
     Name = fact.Name;
 }