public ExportDefinition() { Register <ExportDefinitionCreated>(@event => { ExportDefinitionId = new ExportDefinitionId(@event.ExportDefinitionId); Title = @event.Title; ExportRowList = new List <ExportRow>(); }); Register <ExportRowAddedToExportDefinition>(@event => { var row = new ExportRow(ApplyChange); row.Route(@event); ExportRowList.Add(row); }); }
public void AddRowToRowsCollection(Guid exportRowId, string name) { // delgate invariant checks to the object that is interested in this stuff ApplyChange(ExportRow.CreateNewRow(exportRowId, name)); }