Table of Contents

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 SqlExpression

An expression on which LIKE is applied.

pattern SqlExpression

A pattern to search.

escapeChar SqlExpression

An optional escape character to use in LIKE.

typeMapping RelationalTypeMapping

The RelationalTypeMapping associated with the expression.

Properties

EscapeChar

The escape chater to use in LIKE.

public virtual SqlExpression EscapeChar { get; }

Property Value

SqlExpression

Match

The expression on which LIKE is applied.

public virtual SqlExpression Match { get; }

Property Value

SqlExpression

Pattern

The pattern to search in Match.

public virtual SqlExpression Pattern { get; }

Property Value

SqlExpression

Methods

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

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 SqlExpression

The Match property of the result.

pattern SqlExpression

The Pattern property of the result.

escapeChar SqlExpression

The 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

Returns

Expression