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>
 /// Initializes a new instance of the LinqToAstoriaQueryResolver class.
 /// </summary>
 /// <param name="identifierGenerator">Identifier generator.</param>
 /// <param name="typeLibrary">The query type library.</param>
 public LinqToAstoriaQueryResolver(IIdentifierGenerator identifierGenerator, QueryTypeLibrary typeLibrary)
 {
     this.parameterNameResolutionVisitor = new LinqToAstoriaParameterNameResolutionVisitor(identifierGenerator);
     this.typeResolver = new LinqToAstoriaTypeResolutionVisitor(typeLibrary);
     this.customFunctionResolutionVisitor = new LinqToAstoriaCustomFunctionResolutionVisitor(this.typeResolver);
 }
 /// <summary>
 /// Initializes a new instance of the LinqToAstoriaQueryResolver class.
 /// </summary>
 /// <param name="identifierGenerator">Identifier generator.</param>
 /// <param name="typeLibrary">The query type library.</param>
 public LinqToAstoriaQueryResolver(IIdentifierGenerator identifierGenerator, QueryTypeLibrary typeLibrary)
 {
     this.parameterNameResolutionVisitor = new LinqToAstoriaParameterNameResolutionVisitor(identifierGenerator);
     this.typeResolver = new LinqToAstoriaTypeResolutionVisitor(typeLibrary);
     this.customFunctionResolutionVisitor = new LinqToAstoriaCustomFunctionResolutionVisitor(this.typeResolver);
 }