Class LikeExpression
- Namespace
- Microsoft.EntityFrameworkCore.Query.SqlExpressions
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
An expression that represents a LIKE in a SQL tree.
This type is typically used by database providers (and other extensions). It is generally not used in application code.
public class LikeExpression : SqlExpression, IPrintableExpression
- Inheritance
-
LikeExpression
- Implements
-
IPrintableExpression
- Inherited Members
Constructors
LikeExpression(SqlExpression, SqlExpression, SqlExpression, RelationalTypeMapping)
Creates a new instance of the LikeExpression class.
public LikeExpression(SqlExpression match, SqlExpression pattern, SqlExpression escapeChar, RelationalTypeMapping typeMapping)
Parameters
matchSqlExpressionAn expression on which LIKE is applied.
patternSqlExpressionA pattern to search.
escapeCharSqlExpressionAn optional escape character to use in LIKE.
typeMappingRelationalTypeMappingThe RelationalTypeMapping associated with the expression.
Properties
EscapeChar
The escape chater to use in LIKE.
public virtual SqlExpression EscapeChar { get; }
Property Value
Match
The expression on which LIKE is applied.
public virtual SqlExpression Match { get; }
Property Value
Pattern
The pattern to search in Match.
public virtual SqlExpression Pattern { get; }
Property Value
Methods
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
Print(ExpressionPrinter)
protected override void Print(ExpressionPrinter expressionPrinter)
Parameters
expressionPrinterExpressionPrinter
Update(SqlExpression, SqlExpression, SqlExpression)
Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
public virtual LikeExpression Update(SqlExpression match, SqlExpression pattern, SqlExpression escapeChar)
Parameters
matchSqlExpressionThe Match property of the result.
patternSqlExpressionThe Pattern property of the result.
escapeCharSqlExpressionThe EscapeChar property of the result.
Returns
- LikeExpression
This expression if no children changed, or an expression with the updated children.
VisitChildren(ExpressionVisitor)
protected override Expression VisitChildren(ExpressionVisitor visitor)
Parameters
visitorExpressionVisitor