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