Example #1
0
        /// <summary>
        /// Parse a specific query with a specific set variables and produce a <see cref="DbLambda"/>.
        /// </summary>
        public DbLambda ParseLambda(string query, params DbVariableReferenceExpression[] variables)
        {
            EntityUtil.CheckArgumentNull(query, "query");
            if (variables != null)
            {
                IEnumerable <DbVariableReferenceExpression> varsEnum = variables;
                EntityUtil.CheckArgumentContainsNull(ref varsEnum, "variables");
            }

            DbLambda result = CqlQuery.CompileQueryCommandLambda(query, _perspective, null /* parser options - use default */, null /* parameters */, variables);

            return(result);
        }
Example #2
0
        /// <summary>
        /// Parse the specified <paramref name="query"/> with the specified <paramref name="parameters"/>.
        /// </summary>
        /// <param name="query">EntitySQL query to be parsed.</param>
        /// <param name="parameters">optional query parameters</param>
        /// <returns><see cref="ParseResult"/> containing <see cref="DbCommandTree"/> and information describing inline function definitions if any.</returns>
        public ParseResult Parse(string query, params DbParameterReferenceExpression[] parameters)
        {
            EntityUtil.CheckArgumentNull(query, "query");
            if (parameters != null)
            {
                IEnumerable <DbParameterReferenceExpression> paramsEnum = parameters;
                EntityUtil.CheckArgumentContainsNull(ref paramsEnum, "parameters");
            }

            var result = CqlQuery.Compile(query, _perspective, null /* parser options - use default */, parameters);

            return(result);
        }