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