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; }
public void Apply(StudentCreatedFact fact) { Id = fact.AggregateRootId; GivenName = fact.GivenName; FamilyName = fact.FamilyName; }
public void Apply(StudentCreatedFact fact) { Id = fact.AggregateRootId; FirstName = fact.FirstName; LastName = fact.LastName; }