/// <summary> /// Returns true if this annotation applies to the specified provider. /// </summary> internal bool AppliesTo(SqlProvider.ProviderMode provider) { foreach (SqlProvider.ProviderMode p in providers) { if (p == provider) { return true; } } return false; }
/// <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); } } }
internal Visitor(SqlFactory sql, SqlProvider.ProviderMode providerMode) { this.sql = sql; this.providerMode = providerMode; this.skipper = new SqlSelectionSkipper(this); }
internal static SqlNode Convert(SqlNode node, SqlFactory sql, SqlProvider.ProviderMode providerMode) { return new Visitor(sql, providerMode).Visit(node); }
internal Visitor(SqlProvider.ProviderMode provider) { this.provider = provider; }