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
match
SqlExpressionAn expression on which LIKE is applied.
pattern
SqlExpressionA pattern to search.
escapeChar
SqlExpressionAn optional escape character to use in LIKE.
typeMapping
RelationalTypeMappingThe 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
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Print(ExpressionPrinter)
protected override void Print(ExpressionPrinter expressionPrinter)
Parameters
expressionPrinter
ExpressionPrinter
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
match
SqlExpressionThe Match property of the result.
pattern
SqlExpressionThe Pattern property of the result.
escapeChar
SqlExpressionThe 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
visitor
ExpressionVisitor