示例#1
0
 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;
 }
		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;
		}
		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;
		}
		internal override SqlExpression VisitLike(SqlLike like) {
			like.Expression = this.FetchExpression(like.Expression);
			like.Pattern = this.FetchExpression(like.Pattern);
			return base.VisitLike(like);
		}
示例#6
0
		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;
		}