Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RavenQueryInspector{T}"/> class.
        /// </summary>
        public RavenQueryInspector(
            IRavenQueryProvider provider,
            RavenQueryStatistics queryStats,
            RavenQueryHighlightings highlightings,
            string indexName,
            Expression expression,
            InMemoryDocumentSessionOperations session
#if !SILVERLIGHT
            , IDatabaseCommands databaseCommands
#endif
            , IAsyncDatabaseCommands asyncDatabaseCommands,
            bool isMapReduce
            )
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            this.provider      = provider.For <T>();
            this.queryStats    = queryStats;
            this.highlightings = highlightings;
            this.indexName     = indexName;
            this.session       = session;
#if !SILVERLIGHT
            this.databaseCommands = databaseCommands;
#endif
            this.asyncDatabaseCommands = asyncDatabaseCommands;
            this.isMapReduce           = isMapReduce;
            this.provider.AfterQueryExecuted(this.AfterQueryExecuted);
            this.expression = expression ?? Expression.Constant(this);
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RavenQueryInspector{T}"/> class.
        /// </summary>
        public void Init(
            IRavenQueryProvider provider,
            QueryStatistics queryStats,
#if FEATURE_HIGHLIGHTING
            QueryHighlightings highlightings,
#endif
            string indexName,
            string collectionName,
            Expression expression,
            InMemoryDocumentSessionOperations session,
            bool isMapReduce)
        {
            _conventions = session.Conventions;
            _provider    = provider?.For <T>() ?? throw new ArgumentNullException(nameof(provider));
            _queryStats  = queryStats;
#if FEATURE_HIGHLIGHTING
            _highlightings = highlightings;
#endif
            _indexName      = indexName;
            _collectionName = collectionName;
            _session        = session;
            _isMapReduce    = isMapReduce;
            _provider.AfterQueryExecuted(AfterQueryExecuted);
            _expression = expression ?? Expression.Constant(this);
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RavenQueryInspector{T}"/> class.
        /// </summary>
        public RavenQueryInspector(
            IRavenQueryProvider provider,
            RavenQueryStatistics queryStats,
            string indexName,
            Expression expression
#if !SILVERLIGHT
            , IDatabaseCommands databaseCommands
#endif
#if !NET_3_5
            , IAsyncDatabaseCommands asyncDatabaseCommands
#endif
            )
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            this.provider   = provider.For <T>();
            this.queryStats = queryStats;
            this.indexName  = indexName;
#if !SILVERLIGHT
            this.databaseCommands = databaseCommands;
#endif
#if !NET_3_5
            this.asyncDatabaseCommands = asyncDatabaseCommands;
#endif
            this.provider.AfterQueryExecuted(queryStats.UpdateQueryStats);
            this.expression = expression ?? Expression.Constant(this);
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RavenQueryInspector{T}"/> class.
 /// </summary>
 public void Init(
     IRavenQueryProvider provider,
     RavenQueryStatistics queryStats,
     RavenQueryHighlightings highlightings,
     string indexName,
     Expression expression,
     InMemoryDocumentSessionOperations session
     ,
     bool isMapReduce
     )
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     this.provider      = provider.For <T>();
     this.queryStats    = queryStats;
     this.highlightings = highlightings;
     this.indexName     = indexName;
     this.session       = session;
     this.isMapReduce   = isMapReduce;
     this.provider.AfterQueryExecuted(this.AfterQueryExecuted);
     this.expression = expression ?? Expression.Constant(this);
 }