示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueryficationEngine"/> class.
        /// </summary>
        /// <param name="propertyMetadataFactory">An implementation of the <see cref="IPropertyMetadataFactory"/> interface.</param>
        /// <param name="propertyReflectorSelector">An implementation of the <see cref="IPropertyReflectorSelector"/> interface.</param>
        /// <param name="instanceFactory">An implementation of the <see cref="IInstanceFactory"/> interface.</param>
        /// <param name="valueProcessorFactory">An implementation of the <see cref="IValueProcessorFactory"/> interface.</param>
        /// <exception cref="ArgumentNullException">The value of '<paramref name="propertyMetadataFactory"/>', '<paramref name="propertyReflectorSelector"/>', '<paramref name="instanceFactory"/>' and '<paramref name="valueProcessorFactory"/>' cannot be null. </exception>
        public QueryficationEngine(IPropertyMetadataFactory propertyMetadataFactory, IPropertyReflectorSelector propertyReflectorSelector, IInstanceFactory instanceFactory, IValueProcessorFactory valueProcessorFactory)
        {
            if (propertyMetadataFactory == null)
            {
                throw new ArgumentNullException(nameof(propertyMetadataFactory));
            }

            if (propertyReflectorSelector == null)
            {
                throw new ArgumentNullException(nameof(propertyReflectorSelector));
            }

            if (instanceFactory == null)
            {
                throw new ArgumentNullException(nameof(instanceFactory));
            }

            if (valueProcessorFactory == null)
            {
                throw new ArgumentNullException(nameof(valueProcessorFactory));
            }

            this.valueProcessorFactory     = valueProcessorFactory;
            this.propertyMetadataFactory   = propertyMetadataFactory;
            this.propertyReflectorSelector = propertyReflectorSelector;
            this.instanceFactory           = instanceFactory;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ParserContext"/> class.
        /// </summary>
        /// <param name="query">The query to parse.</param>
        /// <param name="configuration">An implementation of the <see cref="IQueryfyConfiguration"/> interface.</param>
        /// <param name="queryficationEngine">An implementation of the <see cref="IQueryficationEngine"/> interface.</param>
        /// <param name="valueProcessorFactory">An implementation of the <see cref="IValueProcessorFactory"/> interface.</param>
        /// <param name="lambdaExpressionInitializer">An implementation of the <see cref="ILambdaExpressionInitializer"/> interface.</param>
        /// <param name="instanceFactory">An implementation of the <see cref="IInstanceFactory"/> interface.</param>
        /// <exception cref="ArgumentNullException">The value of '<paramref name="query"/>', '<paramref name="configuration"/>', '<paramref name="queryficationEngine"/>', '<paramref name="valueProcessorFactory"/>', '<paramref name="lambdaExpressionInitializer"/>' and '<paramref name="instanceFactory"/>' cannot be null. </exception>
        public ParserContext(String query, IQueryfyConfiguration configuration, IQueryficationEngine queryficationEngine, IValueProcessorFactory valueProcessorFactory, ILambdaExpressionInitializer lambdaExpressionInitializer, IInstanceFactory instanceFactory)
        {
            if (String.IsNullOrEmpty(query))
            {
                throw new ArgumentNullException(nameof(query));
            }

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (queryficationEngine == null)
            {
                throw new ArgumentNullException(nameof(queryficationEngine));
            }

            if (valueProcessorFactory == null)
            {
                throw new ArgumentNullException(nameof(valueProcessorFactory));
            }

            if (lambdaExpressionInitializer == null)
            {
                throw new ArgumentNullException(nameof(lambdaExpressionInitializer));
            }

            if (instanceFactory == null)
            {
                throw new ArgumentNullException(nameof(instanceFactory));
            }

            this.queryficationDictionary     = QueryficationDictionary.FromQueryString(query, configuration);
            this.propertyParserMaps          = new ParserMapCollection();
            this.Configuration               = configuration;
            this.queryficationEngine         = queryficationEngine;
            this.InstanceFactory             = instanceFactory;
            this.ValueProcessorFactory       = valueProcessorFactory;
            this.lambdaExpressionInitializer = lambdaExpressionInitializer;
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueryficationContext"/> class.
        /// </summary>
        /// <param name="configuration">An implementation of the <see cref="IQueryfyConfiguration"/> interface.</param>
        /// <param name="queryficationEngine">An implementation of the <see cref="IQueryficationEngine"/> interface.</param>
        /// <param name="urlValueProcessorFactory">An implementation of the <see cref="IValueProcessorFactory"/> interface.</param>
        /// <param name="lambdaExpressionInitializer">An implementation of the <see cref="ILambdaExpressionInitializer"/> interface.</param>
        /// <param name="instanceFactory">An implementation of the <see cref="IInstanceFactory"/> interface</param>
        /// <exception cref="ArgumentNullException">The value of '<paramref name="configuration"/>', '<paramref name="instanceFactory"/>', '<paramref name="lambdaExpressionInitializer"/>', '<paramref name="queryficationEngine"/>' and '<paramref name="urlValueProcessorFactory"/>' cannot be null. </exception>
        public QueryficationContext([NotNull] IQueryfyConfiguration configuration, [NotNull] IQueryficationEngine queryficationEngine, [NotNull] IValueProcessorFactory urlValueProcessorFactory, [NotNull] ILambdaExpressionInitializer lambdaExpressionInitializer, [NotNull] IInstanceFactory instanceFactory)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            if (queryficationEngine == null)
            {
                throw new ArgumentNullException(nameof(queryficationEngine));
            }

            if (urlValueProcessorFactory == null)
            {
                throw new ArgumentNullException(nameof(urlValueProcessorFactory));
            }

            if (lambdaExpressionInitializer == null)
            {
                throw new ArgumentNullException(nameof(lambdaExpressionInitializer));
            }

            if (instanceFactory == null)
            {
                throw new ArgumentNullException(nameof(instanceFactory));
            }

            this.queryficationDictionary     = new QueryficationDictionary();
            this.Configuration               = configuration;
            this.ValueProcessorFactory       = urlValueProcessorFactory;
            this.lambdaExpressionInitializer = lambdaExpressionInitializer;
            this.queryficationEngine         = queryficationEngine;
            this.InstanceFactory             = instanceFactory;
        }