public Student(string name, Guid?studentId = null, Guid?eventId = null, bool purgeEvents = true) { Name = name; if (studentId.HasValue) { StudentId = studentId.Value; } PurgeEvents = purgeEvents; var @event = new StudentCreatedEvent { StudentId = StudentId, Name = name }; if (eventId.HasValue) { @event.EventId = eventId.Value; } else { @event.EventId = CqrsConstants.Event1Id; } RaiseEvent(@event); }
public StudentFlattened(StudentCreatedEvent @event) { ProcessEvent(@event, e => { Id = @event.SourceId; FirstName = @event.Input; LastName = @event.Input; }); }
public StudentFlattened(StudentCreatedEvent @event) { StudentId = @event.StudentId; Name = @event.Name; }