public N1QlQueryModelVisitor(IMemberNameResolver memberNameResolver, IMethodCallTranslatorProvider methodCallTranslatorProvider,
     ITypeSerializer serializer)
 {
     _queryGenerationContext = new N1QlQueryGenerationContext()
     {
         //MemberNameResolver = new JsonNetMemberNameResolver(ClusterHelper.Get().Configuration.SerializationSettings.ContractResolver),
         //MethodCallTranslatorProvider = new DefaultMethodCallTranslatorProvider()
         MemberNameResolver = memberNameResolver,
         MethodCallTranslatorProvider = methodCallTranslatorProvider,
         Serializer = serializer
     };
 }
 public N1QlQueryModelVisitor(IMemberNameResolver memberNameResolver, IMethodCallTranslatorProvider methodCallTranslatorProvider,
     ITypeSerializer serializer, ILoggerFactory loggerFactory)
 {
     _loggerFactory = loggerFactory;
     Log = _loggerFactory.CreateLogger<N1QlQueryModelVisitor>();
     _queryPartsAggregator = new QueryPartsAggregator(_loggerFactory);
     _queryGenerationContext = new N1QlQueryGenerationContext()
     {
         //MemberNameResolver = new JsonNetMemberNameResolver(ClusterHelper.Get().Configuration.SerializationSettings.ContractResolver),
         //MethodCallTranslatorProvider = new DefaultMethodCallTranslatorProvider()
         MemberNameResolver = memberNameResolver,
         MethodCallTranslatorProvider = methodCallTranslatorProvider,
         Serializer = serializer
     };
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuntimeAnonymousTypeSerializer{T,TSource}"/> class.
 /// </summary>
 /// <param name="nameResolver">
 /// The <see cref="IMemberNameResolver"/> used to resolve name aliasing.
 /// </param>
 public RuntimeAnonymousTypeSerializer(IMemberNameResolver nameResolver)
 {
     _nameResolver = nameResolver;
 }
Example #4
0
 public TestSerializerFactory()
 {
     _memberNameResolver = new MemberNameResolver();
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="FilterExpressionFactory" /> class.
 /// </summary>
 /// <param name="memberNameResolver">An <see cref="IMemberNameResolver" /> for name resolution.</param>
 /// <param name="expressionFactories">The custom <see cref="IValueExpressionFactory" /> to use for value conversion.</param>
 public FilterExpressionFactory(IMemberNameResolver memberNameResolver,
     IEnumerable<IValueExpressionFactory> expressionFactories)
 {
     _valueReader = new ParameterValueReader(expressionFactories);
     _memberNameResolver = memberNameResolver;
 }
Example #6
0
 protected void SetContractResolver(IContractResolver contractResolver)
 {
     _memberNameResolver = new JsonNetMemberNameResolver(contractResolver);
 }
Example #7
0
        private IQueryable <TResult> InnerCreateQueryable <TResult>(IRestClient client, ISerializerFactory serializerFactory, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, Expression expression, Type sourceType)
        {
            Contract.Requires(client != null);
            Contract.Requires(serializerFactory != null);
            Contract.Requires(expression != null);
            Contract.Requires(memberNameResolver != null);
            Contract.Requires(valueWriters != null);

            return(new RestGetQueryable <TResult>(client, serializerFactory, memberNameResolver, valueWriters, sourceType, expression));
        }
        public RestDeleteQueryable(IRestClient client, ISerializerFactory serializerFactory, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, Expression expression, Type sourceType)
            : this(client, serializerFactory, memberNameResolver, valueWriters, sourceType)
        {
            CustomContract.Requires(client != null);
            CustomContract.Requires(serializerFactory != null);
            CustomContract.Requires(memberNameResolver != null);
            CustomContract.Requires(valueWriters != null);
            CustomContract.Requires(expression != null);

            Expression = expression;
        }
Example #9
0
 /// <summary>
 /// Create a new instance of IQueryable.
 /// </summary>
 /// <param name="bucket">Specifies the source bucket.</param>
 /// <param name="org">Specifies the source organization.</param>
 /// <param name="queryApi">The underlying API to execute Flux Query.</param>
 /// <param name="memberResolver">Resolver for customized names.</param>
 public InfluxDBQueryable(string bucket, string org, QueryApiSync queryApi, IMemberNameResolver memberResolver) : base(CreateQueryParser(),
                                                                                                                       CreateExecutor(bucket, org, queryApi, memberResolver))
 {
 }
Example #10
0
 /// <summary>
 /// Create a new instance of IQueryable.
 /// </summary>
 /// <param name="bucket">Specifies the source bucket.</param>
 /// <param name="org">Specifies the source organization.</param>
 /// <param name="queryApi">The underlying API to execute Flux Query.</param>
 /// <param name="memberResolver">Resolver for customized names.</param>
 /// <returns>new instance for of Queryable</returns>
 public static InfluxDBQueryable <T> Queryable(string bucket, string org, QueryApiSync queryApi, IMemberNameResolver memberResolver)
 {
     return(new InfluxDBQueryable <T>(bucket, org, queryApi, memberResolver));
 }
 internal TimeColumnName(MemberInfo member, IMemberNameResolver memberNameResolver)
 {
     _delegate = new ColumnName(member, memberNameResolver);
 }
 public TestSerializerFactory(IMemberNameResolver memberNameResolver)
 {
     _memberNameResolver = memberNameResolver;
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="bucket">Specifies the source bucket.</param>
 /// <param name="org">Specifies the source organization.</param>
 /// <param name="queryApi">The underlying API to execute Flux Query.</param>
 public InfluxDBQueryExecutor(string bucket, string org, QueryApiSync queryApi, IMemberNameResolver memberResolver)
 {
     _bucket         = bucket;
     _org            = org;
     _queryApi       = queryApi;
     _memberResolver = memberResolver;
 }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterParser{T}"/> class.
 /// </summary>
 /// <param name="memberNameResolver">The <see cref="IMemberNameResolver"/> to use for name resolution.</param>
 /// <param name="valueExpressionFactories">The custom <see cref="IValueExpressionFactory"/> to use for value conversion.</param>
 public ParameterParser(Linq2ODataSettings settings, IMemberNameResolver memberNameResolver, IEnumerable <IValueExpressionFactory> valueExpressionFactories)
     : this(settings, new FilterExpressionFactory(memberNameResolver, valueExpressionFactories), new SortExpressionFactory(memberNameResolver), new SelectExpressionFactory <T>(memberNameResolver, new RuntimeTypeProvider(memberNameResolver)))
 {
 }
Example #15
0
 public RestQueryableProvider(IAsyncRestClientFactory asyncRestClient, ISerializerFactory serializerFactory, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, IScheduler subscriberScheduler, IScheduler observerScheduler)
     : base(asyncRestClient, serializerFactory, memberNameResolver, valueWriters, subscriberScheduler, observerScheduler)
 {
     Contract.Requires(asyncRestClient != null);
     Contract.Requires(serializerFactory != null);
     Contract.Requires(subscriberScheduler != null);
     Contract.Requires(memberNameResolver != null);
     Contract.Requires(valueWriters != null);
     Contract.Requires(observerScheduler != null);
 }
Example #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RestObservable{T}"/> class.
        /// </summary>
        /// <param name="restClientFactory">An <see cref="IAsyncRestClientFactory"/> to perform requests.</param>
        /// <param name="serializerFactory">An <see cref="ISerializerFactory"/> to perform deserialization.</param>
        /// <param name="memberNameResolver">An <see cref="IMemberNameResolver"/> for member name resolution.</param>
        /// <param name="valueWriters">Custom value writers.</param>
        public RestObservable(IAsyncRestClientFactory restClientFactory, ISerializerFactory serializerFactory, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters)
        {
            Contract.Requires <ArgumentNullException>(restClientFactory != null);
            Contract.Requires <ArgumentNullException>(serializerFactory != null);
            Contract.Requires <ArgumentNullException>(memberNameResolver != null);
            Contract.Requires <ArgumentNullException>(valueWriters != null);

            _restClientFactory  = restClientFactory;
            _serializerFactory  = serializerFactory;
            _memberNameResolver = memberNameResolver;
            _valueWriters       = valueWriters.ToArray();
        }
        public RestDeleteQueryable(IRestClient client, ISerializerFactory serializerFactory, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, Type sourceType)
            : base(client, serializerFactory, memberNameResolver, valueWriters)
        {
            CustomContract.Requires(client != null);
            CustomContract.Requires(serializerFactory != null);
            CustomContract.Requires(memberNameResolver != null);
            CustomContract.Requires(valueWriters != null);

            _restDeleteQueryProvider = new RestDeleteQueryProvider <T>(client, serializerFactory, new ExpressionProcessor(new ExpressionWriter(MemberNameResolver, ValueWriters), MemberNameResolver), MemberNameResolver, ValueWriters, sourceType);
            Provider   = _restDeleteQueryProvider;
            Expression = Expression.Constant(this);
        }
Example #18
0
        private static IQueryExecutor CreateExecutor(string bucket, string org, QueryApiSync queryApi, IMemberNameResolver memberResolver)
        {
            Arguments.CheckNonEmptyString(bucket, nameof(bucket));
            Arguments.CheckNonEmptyString(org, nameof(org));
            Arguments.CheckNotNull(queryApi, nameof(queryApi));

            return(new InfluxDBQueryExecutor(bucket, org, queryApi, memberResolver));
        }
Example #19
0
        public RestPutQueryProvider(IRestClient client, ISerializerFactory serializerFactory, IExpressionProcessor expressionProcessor, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, Stream inputData, Type sourceType)
            : base(client, serializerFactory, expressionProcessor, memberNameResolver, valueWriters, sourceType)
        {
            Contract.Requires(client != null);
            Contract.Requires(serializerFactory != null);
            Contract.Requires(expressionProcessor != null);
            Contract.Requires(valueWriters != null);
            Contract.Requires(inputData != null);

            _inputData = inputData;
        }
 internal ColumnName(MemberInfo member, IMemberNameResolver memberResolver)
 {
     _member         = member;
     _memberResolver = memberResolver;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SortExpressionFactory"/> class.
 /// </summary>
 /// <param name="nameResolver">The <see cref="IMemberNameResolver"/> for name resolution.</param>
 public SortExpressionFactory(IMemberNameResolver nameResolver)
 {
     _nameResolver = nameResolver;
 }
Example #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RuntimeTypeProvider"/> class.
 /// </summary>
 /// <param name="nameResolver"></param>
 public RuntimeTypeProvider(IMemberNameResolver nameResolver)
 {
     _nameResolver = nameResolver;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ODataExpressionConverter"/> class.
        /// </summary>
        /// <param name="valueWriters">The custom value writers to use.</param>
        /// <param name="valueExpressionFactories">The custom expression writers to use.</param>
        /// <param name="memberNameResolver">The custom <see cref="IMemberNameResolver"/> to use.</param>
        public ODataExpressionConverter(IEnumerable <IValueWriter> valueWriters, IEnumerable <IValueExpressionFactory> valueExpressionFactories, IMemberNameResolver memberNameResolver = null)
        {
            var writers             = (valueWriters ?? Enumerable.Empty <IValueWriter>()).ToArray();
            var expressionFactories = (valueExpressionFactories ?? Enumerable.Empty <IValueExpressionFactory>()).ToArray();
            var nameResolver        = memberNameResolver ?? new MemberNameResolver();

            _writer = new ExpressionWriter(nameResolver, writers);
            _parser = new FilterExpressionFactory(nameResolver, expressionFactories);
        }
Example #24
0
 protected RestQueryProviderContracts(IRestClient client, ISerializerFactory serializerFactory, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, IExpressionProcessor expressionProcessor, Type sourceType)
     : base(client, serializerFactory, expressionProcessor, memberNameResolver, valueWriters, sourceType)
 {
 }
Example #25
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RuntimeTypeProvider"/> class.
        /// </summary>
        /// <param name="nameResolver"></param>
        public RuntimeTypeProvider(IMemberNameResolver nameResolver)
        {
            //Contract.Requires(nameResolver != null);

            _nameResolver = nameResolver;
        }
Example #26
0
        public RestQueryProvider(IRestClient client, ISerializerFactory serializerFactory, IExpressionProcessor expressionProcessor, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, Type sourceType)
        {
            CustomContract.Requires(client != null);
            CustomContract.Requires(serializerFactory != null);
            CustomContract.Requires(expressionProcessor != null);
            CustomContract.Requires(valueWriters != null);

            Client               = client;
            _serializerFactory   = serializerFactory;
            _expressionProcessor = expressionProcessor;
            _memberNameResolver  = memberNameResolver;
            _valueWriters        = valueWriters;
            _parameterBuilder    = new ParameterBuilder(client.ServiceBase, sourceType ?? typeof(T));
        }
Example #27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterParser{T}"/> class.
 /// </summary>
 /// <param name="memberNameResolver">The <see cref="IMemberNameResolver"/> to use for name resolution.</param>
 /// <param name="valueExpressionFactories">The custom <see cref="IValueExpressionFactory"/> to use for value conversion.</param>
 public ParameterParser(IMemberNameResolver memberNameResolver, IEnumerable <IValueExpressionFactory> valueExpressionFactories)
     : this(new FilterExpressionFactory(memberNameResolver, valueExpressionFactories), new SortExpressionFactory(memberNameResolver), new SelectExpressionFactory <T>(memberNameResolver, new RuntimeTypeProvider(memberNameResolver)))
 {
     //Contract.Requires<ArgumentNullException>(memberNameResolver != null);
     //Contract.Requires<ArgumentNullException>(valueExpressionFactories != null);
 }
Example #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ParameterParser{T}"/> class.
 /// </summary>
 /// <param name="memberNameResolver">The <see cref="IMemberNameResolver"/> to use for name resolution.</param>
 public ParameterParser(IMemberNameResolver memberNameResolver)
     : this(new FilterExpressionFactory(memberNameResolver, Enumerable.Empty <IValueExpressionFactory>()), new SortExpressionFactory(memberNameResolver), new SelectExpressionFactory <T>(memberNameResolver, new RuntimeTypeProvider(memberNameResolver)))
 {
     CustomContract.Requires <ArgumentNullException>(memberNameResolver != null);
 }
Example #29
0
 internal NamedField(MemberInfo member, IMemberNameResolver memberResolver)
 {
     _member         = member;
     _memberResolver = memberResolver;
 }
Example #30
0
        public RestPostQueryable(IRestClient client, ISerializerFactory serializerFactory, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, Expression expression, Stream inputData, Type sourceType)
            : base(client, serializerFactory, memberNameResolver, valueWriters)
        {
            Contract.Requires(client != null);
            Contract.Requires(serializerFactory != null);
            Contract.Requires(expression != null);
            Contract.Requires(memberNameResolver != null);
            Contract.Requires(valueWriters != null);
            Contract.Requires(inputData != null);

            _restPostQueryProvider = new RestPostQueryProvider <T>(
                client,
                serializerFactory,
                new ExpressionProcessor(new ExpressionWriter(memberNameResolver, ValueWriters), memberNameResolver),
                memberNameResolver,
                ValueWriters,
                inputData,
                sourceType);
            Provider   = _restPostQueryProvider;
            Expression = expression;
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="RuntimeTypeProvider" /> class.
 /// </summary>
 /// <param name="nameResolver"></param>
 public RuntimeTypeProvider(IMemberNameResolver nameResolver)
 {
     _nameResolver = nameResolver;
 }
Example #32
0
        public RestGetQueryable(IRestClient client, ISerializerFactory serializerFactory, IMemberNameResolver memberNameResolver, IEnumerable <IValueWriter> valueWriters, Type sourceType, Expression expression)
            : base(client, serializerFactory, memberNameResolver, valueWriters)
        {
            CustomContract.Requires <ArgumentNullException>(client != null);
            CustomContract.Requires <ArgumentNullException>(serializerFactory != null);
            CustomContract.Requires <ArgumentNullException>(memberNameResolver != null);
            CustomContract.Requires <ArgumentNullException>(valueWriters != null);
            CustomContract.Requires <ArgumentNullException>(expression != null);

            _restGetQueryProvider = new RestGetQueryProvider <T>(client, serializerFactory, new ExpressionProcessor(new ExpressionWriter(MemberNameResolver, ValueWriters), MemberNameResolver), MemberNameResolver, ValueWriters, sourceType);
            Provider   = _restGetQueryProvider;
            Expression = expression;
        }