Exemple #1
0
        ///<summary>
        /// Get the last equality term for the query
        ///</summary>
        public KeyValuePair <string, string> GetLastEqualityTerm()
        {
            var ravenQueryProvider = new RavenQueryProviderProcessor <T>(provider.QueryGenerator, null, null, indexName, new HashSet <string>(), new Dictionary <string, string>());
            var luceneQuery        = ravenQueryProvider.GetLuceneQueryFor(expression);

            return(((IRavenQueryInspector)luceneQuery).GetLastEqualityTerm());
        }
        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            RavenQueryProviderProcessor <T> ravenQueryProvider = GetRavenQueryProvider();
            var    luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);
            string fields      = "";

            if (ravenQueryProvider.FieldsToFetch.Count > 0)
            {
                fields = "<" + string.Join(", ", ravenQueryProvider.FieldsToFetch.ToArray()) + ">: ";
            }
            return(fields + luceneQuery);
        }
Exemple #3
0
        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            var    ravenQueryProvider = new RavenQueryProviderProcessor <T>(provider.QueryGenerator, null, null, null, new HashSet <string>());
            var    luceneQuery        = ravenQueryProvider.GetLuceneQueryFor(expression);
            string fields             = "";

            if (ravenQueryProvider.FieldsToFetch.Count > 0)
            {
                fields = "<" + string.Join(", ", ravenQueryProvider.FieldsToFetch.ToArray()) + ">: ";
            }
            return(fields + luceneQuery);
        }
        public IndexQuery GetIndexQuery(bool isAsync = true)
        {
            RavenQueryProviderProcessor <T> ravenQueryProvider = GetRavenQueryProvider();

            if (isAsync == false)
            {
                var luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);
                return(luceneQuery.GetIndexQuery(false));
            }
            var asyncLuceneQuery = ravenQueryProvider.GetAsyncLuceneQueryFor(expression);

            return(asyncLuceneQuery.GetIndexQuery(true));
        }
        ///<summary>
        /// Get the last equality term for the query
        ///</summary>
        public KeyValuePair <string, string> GetLastEqualityTerm(bool isAsync = false)
        {
            var ravenQueryProvider = new RavenQueryProviderProcessor <T>(provider.QueryGenerator, null, null, indexName, new HashSet <string>(), new List <RenamedField>(), isMapReduce);

            if (isAsync)
            {
                var luceneQueryAsync = ravenQueryProvider.GetAsyncLuceneQueryFor(expression);
                return(((IRavenQueryInspector)luceneQueryAsync).GetLastEqualityTerm(true));
            }

            var luceneQuery = ravenQueryProvider.GetLuceneQueryFor(expression);

            return(((IRavenQueryInspector)luceneQuery).GetLastEqualityTerm());
        }
Exemple #6
0
        ///<summary>
        /// Get the last equality term for the query
        ///</summary>
        public KeyValuePair <string, string> GetLastEqualityTerm(bool isAsync = false)
        {
            var ravenQueryProvider = new RavenQueryProviderProcessor <T>(provider.QueryGenerator, null, null, indexName, new HashSet <string>(), new List <RenamedField>(), isMapReduce, provider.ResultTransformer, provider.TransformerParameters);

            if (isAsync)
            {
                var asyncDocumentQuery = ravenQueryProvider.GetAsyncDocumentQueryFor(expression);
                return(((IRavenQueryInspector)asyncDocumentQuery).GetLastEqualityTerm(true));
            }

            var documentQuery = ravenQueryProvider.GetDocumentQueryFor(expression);

            return(((IRavenQueryInspector)documentQuery).GetLastEqualityTerm());
        }
Exemple #7
0
        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            RavenQueryProviderProcessor <T> ravenQueryProvider = GetRavenQueryProvider();
            var documentQuery = databaseCommands != null?ravenQueryProvider.GetDocumentQueryFor(expression).ToString()
                                    : ravenQueryProvider.GetAsyncDocumentQueryFor(expression).ToString();

            string fields = "";

            if (ravenQueryProvider.FieldsToFetch.Count > 0)
            {
                fields = "<" + string.Join(", ", ravenQueryProvider.FieldsToFetch.ToArray()) + ">: ";
            }
            return(fields + documentQuery);
        }
Exemple #8
0
        /// <summary>
        /// Returns a <see cref="System.String"/> that represents this instance.
        /// </summary>
        /// <returns>
        /// A <see cref="System.String"/> that represents this instance.
        /// </returns>
        public override string ToString()
        {
            RavenQueryProviderProcessor <T> ravenQueryProvider = GetRavenQueryProvider();
            string query;

            if (asyncDatabaseCommands != null)
            {
                var asyncDocumentQuery = ravenQueryProvider.GetAsyncDocumentQueryFor(expression);
                query = asyncDocumentQuery.GetIndexQuery(true).ToString();
            }
            else
            {
                var documentQuery = ravenQueryProvider.GetDocumentQueryFor(expression);
                query = documentQuery.ToString();
            }

            string fields = "";

            if (ravenQueryProvider.FieldsToFetch.Count > 0)
            {
                fields = "<" + string.Join(", ", ravenQueryProvider.FieldsToFetch.ToArray()) + ">: ";
            }
            return(fields + query);
        }