コード例 #1
0
ファイル: SqlVisitor.cs プロジェクト: modulexcite/LinqToSQL2
 internal virtual SqlExpression VisitLike(SqlLike like) {
     like.Expression = this.VisitExpression(like.Expression);
     like.Pattern = this.VisitExpression(like.Pattern);
     like.Escape = this.VisitExpression(like.Escape);
     return like;
 }
コード例 #2
0
		internal override SqlExpression VisitLike(SqlLike like)
		{
			this.VisitWithParens(like.Expression, like);
			_commandStringBuilder.Append(" LIKE ");
			this.Visit(like.Pattern);
			if(like.Escape != null)
			{
				_commandStringBuilder.Append(" ESCAPE ");
				this.Visit(like.Escape);
			}
			return like;
		}
コード例 #3
0
		internal override SqlExpression VisitLike(SqlLike like)
		{
			return new SqlLike(
				like.ClrType, like.SqlType,
				this.VisitExpression(like.Expression),
				this.VisitExpression(like.Pattern),
				this.VisitExpression(like.Escape),
				like.SourceExpression
				);
		}
コード例 #4
0
		internal override SqlExpression VisitLike(SqlLike like)
		{
			base.VisitLike(like);
			// When comparing a unicode pattern against a non-unicode expression, 
			// we want retype the pattern as non-unicode.
			if(!like.Expression.SqlType.IsUnicodeType && like.Pattern.SqlType.IsUnicodeType &&
			   (like.Pattern.NodeType == SqlNodeType.Value || like.Pattern.NodeType == SqlNodeType.ClientParameter))
			{
				SqlSimpleTypeExpression pattern = (SqlSimpleTypeExpression)like.Pattern;
				pattern.SetSqlType(pattern.SqlType.GetNonUnicodeEquivalent());
			}
			return like;
		}
コード例 #5
0
		internal override SqlExpression VisitLike(SqlLike like) {
			like.Expression = this.FetchExpression(like.Expression);
			like.Pattern = this.FetchExpression(like.Pattern);
			return base.VisitLike(like);
		}
コード例 #6
0
ファイル: NodeFactory.cs プロジェクト: modulexcite/LinqToSQL2
		internal SqlLike Like(SqlExpression expr, SqlExpression pattern, SqlExpression escape, Expression source)
		{
			SqlLike like = new SqlLike(typeof(bool), typeProvider.From(typeof(bool)), expr, pattern, escape, source);
			return like;
		}