Пример #1
0
        private AsyncDocumentQuery <TResult> CreateDocumentQueryInternal <TResult>(QueryData queryData = null)
        {
            var newFieldsToFetch = queryData != null && queryData.Fileds.Length > 0
                ? FieldsToFetchToken.Create(queryData.Fileds, queryData.Projections.ToArray(), queryData.IsCustomFunction)
                : null;

            if (newFieldsToFetch != null)
            {
                UpdateFieldsToFetchToken(newFieldsToFetch);
            }

            var query = new AsyncDocumentQuery <TResult>(
                TheSession,
                IndexName,
                CollectionName,
                IsGroupBy,
                queryData?.DeclareToken,
                queryData?.LoadTokens,
                queryData?.FromAlias)
            {
                PageSize           = PageSize,
                SelectTokens       = SelectTokens,
                FieldsToFetchToken = FieldsToFetchToken,
                WhereTokens        = WhereTokens,
                OrderByTokens      = OrderByTokens,
                GroupByTokens      = GroupByTokens,
                QueryParameters    = QueryParameters,
                Start      = Start,
                Timeout    = Timeout,
                CutoffEtag = CutoffEtag,
                QueryStats = QueryStats,
                TheWaitForNonStaleResults = TheWaitForNonStaleResults,
                Negate    = Negate,
                Includes  = new HashSet <string>(Includes),
                RootTypes = { typeof(T) },
                BeforeQueryExecutedCallback = BeforeQueryExecutedCallback,
                AfterQueryExecutedCallback  = AfterQueryExecutedCallback,
                AfterStreamExecutedCallback = AfterStreamExecutedCallback,
                HighlightedFields           = new List <HighlightedField>(HighlightedFields),
                HighlighterPreTags          = HighlighterPreTags,
                HighlighterPostTags         = HighlighterPostTags,
                DisableEntitiesTracking     = DisableEntitiesTracking,
                DisableCaching      = DisableCaching,
                ShowQueryTimings    = ShowQueryTimings,
                LastEquality        = LastEquality,
                ShouldExplainScores = ShouldExplainScores,
                IsIntersect         = IsIntersect,
                DefaultOperator     = DefaultOperator
            };

            query.AfterQueryExecuted(AfterQueryExecutedCallback);
            return(query);
        }
 internal YieldStream(
     AsyncDocumentSession parent,
     StreamOperation.YieldStreamResults enumerator,
     AsyncDocumentQuery <T> query,
     FieldsToFetchToken fieldsToFetch,
     CancellationToken token) :
     base(enumerator, token)
 {
     _parent        = parent;
     _query         = query;
     _fieldsToFetch = fieldsToFetch;
 }
Пример #3
0
        private AsyncDocumentQuery <TResult> CreateDocumentQueryInternal <TResult>(FieldsToFetchToken newFieldsToFetch = null)
        {
            if (newFieldsToFetch != null)
            {
                UpdateFieldsToFetchToken(newFieldsToFetch);
            }

            var query = new AsyncDocumentQuery <TResult>(
                TheSession,
                IndexName,
                CollectionName,
                IsGroupBy)
            {
                PageSize           = PageSize,
                SelectTokens       = SelectTokens,
                FieldsToFetchToken = FieldsToFetchToken,
                WhereTokens        = WhereTokens,
                OrderByTokens      = OrderByTokens,
                GroupByTokens      = GroupByTokens,
                QueryParameters    = QueryParameters,
                Start      = Start,
                Timeout    = Timeout,
                CutoffEtag = CutoffEtag,
                QueryStats = QueryStats,
                TheWaitForNonStaleResults        = TheWaitForNonStaleResults,
                TheWaitForNonStaleResultsAsOfNow = TheWaitForNonStaleResultsAsOfNow,
                Negate    = Negate,
                Includes  = new HashSet <string>(Includes),
                RootTypes = { typeof(T) },
                BeforeQueryExecutedCallback = BeforeQueryExecutedCallback,
                AfterQueryExecutedCallback  = AfterQueryExecutedCallback,
                AfterStreamExecutedCallback = AfterStreamExecutedCallback,
                HighlightedFields           = new List <HighlightedField>(HighlightedFields),
                HighlighterPreTags          = HighlighterPreTags,
                HighlighterPostTags         = HighlighterPostTags,
                DisableEntitiesTracking     = DisableEntitiesTracking,
                DisableCaching      = DisableCaching,
                ShowQueryTimings    = ShowQueryTimings,
                LastEquality        = LastEquality,
                ShouldExplainScores = ShouldExplainScores,
                IsIntersect         = IsIntersect,
                DefaultOperator     = DefaultOperator
            };

            query.AfterQueryExecuted(AfterQueryExecutedCallback);
            return(query);
        }
 internal YieldTimeSeriesStream(AsyncDocumentSession parent, AsyncDocumentQuery <T> query, StreamOperation.YieldStreamResults enumerator, CancellationToken token) :
     base(enumerator, token)
 {
     _parent = parent;
     _query  = query;
 }
Пример #5
0
 public AsyncGroupByDocumentQuery(AsyncDocumentQuery <T> query)
 {
     _query = query;
 }