private void Apply(RegistrationCreatedEvent e, bool isNew) { StudentNumber = e.StudentNumber; AcademicTerm = e.AcademicTerm; _courses.AddRange(e.Courses); AddEvent(e, isNew: isNew); }
public Registration(Guid id, string studentNumber, AcademicTerm academicTerm, IReadOnlyList <Course> courses) : base(id) { var thisEvent = new RegistrationCreatedEvent( id: id, version: 0, studentNumber: studentNumber, academicTerm: academicTerm, courses: courses); Apply(thisEvent, isNew: true); }