public SolrQueryTranslator(SolrNetLinqOptions solrNetLinqOptions, MemberContext context, SelectExpressionsCollection selectExpressions)
 {
     SolrNetLinqOptions = solrNetLinqOptions ?? throw new ArgumentNullException(nameof(solrNetLinqOptions));
     Context            = context ?? throw new ArgumentNullException(nameof(context));
     SelectExpressions  = selectExpressions ?? throw new ArgumentNullException(nameof(selectExpressions));
     Options            = selectExpressions.QueryOptions;
 }
Beispiel #2
0
        public static IQueryable <T> AsQueryable <T>(this ISolrBasicReadOnlyOperations <T> operations, Action <SolrNetLinqOptions> setupOptions = null)
        {
            SolrNetLinqOptions options = new SolrNetLinqOptions();

            setupOptions?.Invoke(options);
            return(new SolrQuery <T>(new SolrQueryProvider <T>(
                                         new SolrQueryExecuterWrapperBasicOperations <T>(operations),
                                         options, null, null)));
        }
Beispiel #3
0
        public SolrQueryProvider(
            IExecuter <TEntity> operations,
            SolrNetLinqOptions options,
            MemberContext context,
            SelectExpressionsCollection selectExpressions)
        {
            Operations        = operations ?? throw new ArgumentNullException(nameof(operations));
            Options           = options ?? throw new ArgumentNullException(nameof(options));
            SelectExpressions = selectExpressions ?? new SelectExpressionsCollection();

            if (context == null)
            {
                this.MemberContext = MemberContext.ForType <TEntity>();
                this.MemberContext.FieldSerializer = this.Options.SolrFieldSerializer;
                this.MemberContext.MappingManager  = this.Options.MappingManager;
            }
            else
            {
                this.MemberContext = context;
            }
        }