示例#1
0
文件: UserAccount.cs 项目: nootn/ooto
        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;
        }
示例#2
0
文件: UserAccount.cs 项目: nootn/ooto
 public void Apply(UserCreatedFact fact)
 {
     Id = fact.AggregateRootId;
     Name = fact.Name;
 }