public IndexedSagaDictionary() { _indices = new Dictionary <string, IIndexedSagaProperty <TSaga> >(); BuildIndices(); _indexById = _indices["CorrelationId"]; }
public IEnumerable <SagaInstance <TSaga> > Where(ISagaQuery <TSaga> query) { lock (_lock) { IIndexedSagaProperty <TSaga> index = HasIndexFor(query.FilterExpression); if (index == null) { return(_indexById.Where(query.GetFilter()).ToList()); } var rightValue = GetRightValue(query.FilterExpression); return(index.Where(rightValue, query.GetFilter()).ToList()); } }