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