예제 #1
0
        internal static SqlNode Reduce(SqlNode node, SqlNodeAnnotations annotations)
        {
            Reducer r = new Reducer();

            r.Annotations = annotations;
            return(r.Visit(node));
        }
        /// <summary>
        /// Checks whether the given node is supported on the given server.
        /// </summary>
        internal static void ThrowIfUnsupported(SqlNode node, SqlNodeAnnotations annotations, SqlProvider.ProviderMode provider) {
            // Check to see whether there's at least one SqlServerCompatibilityAnnotation.
            if (annotations.HasAnnotationType(typeof(SqlServerCompatibilityAnnotation))) {
                Visitor visitor = new Visitor(provider);
                visitor.annotations = annotations;
                visitor.Visit(node);

                // If any messages were recorded, then throw an exception.
                if (visitor.reasons.Count > 0) {
                    throw Error.ExpressionNotSupportedForSqlServerVersion(visitor.reasons);
                }
            }
        }
        /// <summary>
        /// Checks whether the given node is supported on the given server.
        /// </summary>
        internal static void ThrowIfUnsupported(SqlNode node, SqlNodeAnnotations annotations, SqlProvider.ProviderMode provider)
        {
            // Check to see whether there's at least one SqlServerCompatibilityAnnotation.
            if (annotations.HasAnnotationType(typeof(SqlServerCompatibilityAnnotation)))
            {
                Visitor visitor = new Visitor(provider);
                visitor.annotations = annotations;
                visitor.Visit(node);

                // If any messages were recorded, then throw an exception.
                if (visitor.reasons.Count > 0)
                {
                    throw Error.ExpressionNotSupportedForSqlServerVersion(visitor.reasons);
                }
            }
        }
예제 #4
0
 internal SqlParameterizer(TypeSystemProvider typeProvider, SqlNodeAnnotations annotations)
 {
     this.typeProvider = typeProvider;
     this.annotations  = annotations;
 }
예제 #5
0
 internal SqlNode AddConversions(SqlNode node, SqlNodeAnnotations annotations)
 {
     visitor.Annotations = annotations;
     return(visitor.Visit(node));
 }
 internal SqlNode AddConversions(SqlNode node, SqlNodeAnnotations annotations) {
     visitor.Annotations = annotations;
     return visitor.Visit(node);
 }
예제 #7
0
 internal Visitor(SqlNodeAnnotations annotations, SqlFactory sql) {
     this.annotations = annotations;
     this.sql = sql;
 }
예제 #8
0
 internal static SqlNode Reduce(SqlNode node, SqlNodeAnnotations annotations, SqlFactory sql) {
     return new Visitor(annotations, sql).Visit(node);
 }
 internal SqlParameterizer(TypeSystemProvider typeProvider, SqlNodeAnnotations annotations) {
     this.typeProvider = typeProvider;
     this.annotations = annotations;
 }
 internal Visitor(SqlFactory factory, SqlNodeAnnotations annotations) {
     this.factory = factory;
     this.annotations = annotations;
 }
		internal static SqlNode Reduce(SqlNode node, SqlFactory factory, SqlNodeAnnotations annotations) {
			Visitor r = new Visitor(factory, annotations);
			return r.Visit(node);			
		}
예제 #12
0
 internal Visitor(SqlFactory factory, SqlNodeAnnotations annotations)
 {
     this.factory     = factory;
     this.annotations = annotations;
 }
예제 #13
0
        internal static SqlNode Reduce(SqlNode node, SqlFactory factory, SqlNodeAnnotations annotations)
        {
            Visitor r = new Visitor(factory, annotations);

            return(r.Visit(node));
        }
		internal static SqlNode Reduce(SqlNode node, SqlNodeAnnotations annotations) {
			Reducer r = new Reducer();
			r.Annotations = annotations;
			return r.Visit(node);			
		}
 internal Visitor(SqlNodeAnnotations annotations, SqlFactory sql)
 {
     this.annotations = annotations;
     this.sql         = sql;
 }
 internal static SqlNode Reduce(SqlNode node, SqlNodeAnnotations annotations, SqlFactory sql)
 {
     return(new Visitor(annotations, sql).Visit(node));
 }