public void Index(AggregateCommit aggregateCommit) { List <IndexRecord> indexRecordsBatch = new List <IndexRecord>(); foreach (var @event in aggregateCommit.Events) { string eventTypeId = @event.Unwrap().GetType().GetContractId(); var record = new IndexRecord(eventTypeId, aggregateCommit.AggregateRootId); indexRecordsBatch.Add(record); } indexStore.Apend(indexRecordsBatch); }
public bool Rebuild(Func <IEnumerable <IndexRecord> > indexRecords) { if (Prepare()) { indexStore.Apend(indexRecords()); Complete(); } return(false); }