コード例 #1
0
        public IndexedSagaDictionary()
        {
            _indices = new Dictionary <string, IIndexedSagaProperty <TSaga> >();

            BuildIndices();

            _indexById = _indices["CorrelationId"];
        }
コード例 #2
0
        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());
            }
        }