public static UserAccount Create(string name) { var fact = new UserCreatedFact {Name = name, AggregateRootId = Guid.NewGuid()}; var userAccount = new UserAccount(); userAccount.Append(fact); userAccount.Apply(fact); return userAccount; }
public void Apply(UserCreatedFact fact) { Id = fact.AggregateRootId; Name = fact.Name; }