예제 #1
0
        public static bool Validate(QuerySpecification querySpecification, bool throwIfHasError = false)
        {
            var validators = new QuerySpecificationValidator[]
            {
                new ExpressionNameTypeValidator(querySpecification)
            };

            return(Validate(throwIfHasError, validators));
        }
        public static bool Validate(QuerySpecification querySpecification, bool throwIfHasError = false)
        {
            var validators = new QuerySpecificationValidator[]
            {
                new ExpressionNameTypeValidator(querySpecification)
            };

            return Validate(throwIfHasError, validators);
        }
예제 #3
0
        /// <summary>
        /// Compiles the specified query specification.
        /// </summary>
        /// <param name="querySpecification">The query specification.</param>
        /// <returns></returns>
        /// <exception cref="System.InvalidOperationException">Can't compile the given query specificaiton as the validation was failed. See InnerException for details.</exception>
        public T Compile(QuerySpecification querySpecification)
        {
            try
            {
                QuerySpecificationValidator.Validate(querySpecification, true);
            }
            catch (Exception ex)
            {
                throw new InvalidOperationException(
                          "Can't compile the given query specificaiton as the validation was failed. See InnerException for details.",
                          ex);
            }

            return(this.PerformCompile(querySpecification));
        }