Ejemplo n.º 1
0
        public override string ToString()
        {
            var ravenQueryProvider = new RavenQueryProvider <T>(provider.Session, provider.IndexName);

            ravenQueryProvider.ProcessExpression(expression);
            string fields = "";

            if (ravenQueryProvider.FieldsToFetch.Count > 0)
            {
                fields = "<" + string.Join(", ", ravenQueryProvider.FieldsToFetch.ToArray()) + ">: ";
            }
            return
                (fields +
                 ravenQueryProvider.LuceneQuery);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Change the result type for the query provider
        /// </summary>
        public IRavenQueryProvider For <S>()
        {
            if (typeof(T) == typeof(S))
            {
                return(this);
            }

            var ravenQueryProvider = new RavenQueryProvider <S>(queryGenerator, indexName, ravenQueryStatistics
#if !SILVERLIGHT
                                                                , databaseCommands
#endif
                                                                , asyncDatabaseCommands
                                                                );

            ravenQueryProvider.Customize(customizeQuery);
            return(ravenQueryProvider);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Change the result type for the query provider
        /// </summary>
        public IRavenQueryProvider For <S>()
        {
            if (typeof(T) == typeof(S))
            {
                return(this);
            }

            var ravenQueryProvider = new RavenQueryProvider <S>(queryGenerator, indexName, ravenQueryStatistics, highlightings
                                                                , databaseCommands
                                                                , asyncDatabaseCommands,
                                                                isMapReduce
                                                                );

            ravenQueryProvider.ResultTransformer = ResultTransformer;
            ravenQueryProvider.Customize(customizeQuery);
            foreach (var transformerParam in this.transformerParamaters)
            {
                ravenQueryProvider.AddTransformerParameter(transformerParam.Key, transformerParam.Value);
            }
            return(ravenQueryProvider);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Change the result type for the query provider
        /// </summary>
        public IRavenQueryProvider For <S>()
        {
            if (typeof(T) == typeof(S))
            {
                return(this);
            }

            var ravenQueryProvider = new RavenQueryProvider <S>(queryGenerator, indexName, ravenQueryStatistics, highlightings
#if !SILVERLIGHT
                                                                , databaseCommands
#endif
                                                                , asyncDatabaseCommands,
                                                                isMapReduce
                                                                );

            ravenQueryProvider.ResultTransformer = ResultTransformer;
            ravenQueryProvider.Customize(customizeQuery);
            foreach (var queryInput in queryInputs)
            {
                ravenQueryProvider.AddQueryInput(queryInput.Key, queryInput.Value);
            }
            return(ravenQueryProvider);
        }