Ejemplo n.º 1
0
        /// <summary>
        /// Generates CodeDom expression from a QueryExpression
        /// </summary>
        /// <param name="query">the QueryExpression</param>
        /// <param name="context">the context in which the query occurs</param>
        /// <returns>the CodeDom expression</returns>
        protected CodeExpressionWithFreeVariables GenerateCodeExpressionFromQuery(QueryExpression query, CodeExpression context)
        {
            ExceptionUtilities.CheckArgumentNotNull(this.Language, "language");
            ExceptionUtilities.CheckObjectNotNull(query, "Function Body has not been specified");

            var methodSyntaxGenerator = new ClientQueryMethodSyntaxCodeGenerator();
            var parameterResolver     = new LinqToAstoriaParameterNameResolutionVisitor(this.IdentifierGenerator);

            return(methodSyntaxGenerator.Generate(parameterResolver.ResolveParameterNames(query), context));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Generates CodeDom expression from a QueryExpression
        /// </summary>
        /// <param name="query">the QueryExpression</param>
        /// <param name="context">the context in which the query occurs</param>
        /// <returns>the CodeDom expression</returns>
        protected CodeExpressionWithFreeVariables GenerateCodeExpressionFromQuery(QueryExpression query, CodeExpression context)
        {
            ExceptionUtilities.CheckArgumentNotNull(this.Language, "language");
            ExceptionUtilities.CheckObjectNotNull(query, "Function Body has not been specified");

            var methodSyntaxGenerator = new ClientQueryMethodSyntaxCodeGenerator();
            var parameterResolver = new LinqToAstoriaParameterNameResolutionVisitor(this.IdentifierGenerator);

            return methodSyntaxGenerator.Generate(parameterResolver.ResolveParameterNames(query), context);
        }