Пример #1
0
        public static Student Create(string firstName, string lastName)
        {
            var id = Guid.NewGuid();
            var createdFact = new StudentCreatedFact
                              {
                                  AggregateRootId = id,
                                  GivenName = firstName,
                                  FamilyName = lastName,
                              };
            var student = new Student();
            student.Append(createdFact);
            student.Apply(createdFact);

            return student;
        }
Пример #2
0
 public void Apply(StudentCreatedFact fact)
 {
     Id = fact.AggregateRootId;
     GivenName = fact.GivenName;
     FamilyName = fact.FamilyName;
 }
Пример #3
0
 public void Apply(StudentCreatedFact fact)
 {
     Id = fact.AggregateRootId;
     FirstName = fact.FirstName;
     LastName = fact.LastName;
 }