DbFunctionsExtensions.Like Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Like(DbFunctions, String, String) |
An implementation of the SQL |
Like(DbFunctions, String, String, String) |
An implementation of the SQL LIKE operation. On relational databases this is usually directly translated to SQL. |
Like(DbFunctions, String, String)
An implementation of the SQL LIKE
operation. On relational databases this is usually directly
translated to SQL.
public static bool Like (this Microsoft.EntityFrameworkCore.DbFunctions _, string matchExpression, string pattern);
public static bool Like (this Microsoft.EntityFrameworkCore.DbFunctions _, string? matchExpression, string? pattern);
static member Like : Microsoft.EntityFrameworkCore.DbFunctions * string * string -> bool
<Extension()>
Public Function Like (_ As DbFunctions, matchExpression As String, pattern As String) As Boolean
Parameters
The DbFunctions instance.
- matchExpression
- String
The string that is to be matched.
- pattern
- String
The pattern which may involve wildcards %,_,[,],^
.
Returns
true
if there is a match.
Remarks
Note that the semantics of the comparison will depend on the database configuration. In particular, it may be either case-sensitive or case-insensitive.
This DbFunction method has no in-memory implementation and will throw if the query switches to client-evaluation. This can happen if the query contains one or more expressions that could not be translated to the store.
Applies to
Like(DbFunctions, String, String, String)
An implementation of the SQL LIKE operation. On relational databases this is usually directly translated to SQL.
public static bool Like (this Microsoft.EntityFrameworkCore.DbFunctions _, string matchExpression, string pattern, string escapeCharacter);
public static bool Like (this Microsoft.EntityFrameworkCore.DbFunctions _, string? matchExpression, string? pattern, string? escapeCharacter);
static member Like : Microsoft.EntityFrameworkCore.DbFunctions * string * string * string -> bool
<Extension()>
Public Function Like (_ As DbFunctions, matchExpression As String, pattern As String, escapeCharacter As String) As Boolean
Parameters
The DbFunctions instance.
- matchExpression
- String
The string that is to be matched.
- pattern
- String
The pattern which may involve wildcards %,_,[,],^.
- escapeCharacter
- String
The escape character (as a single character string) to use in front of %,_,[,],^ if they are not used as wildcards.
Returns
true
if there is a match.
Remarks
Note that the semantics of the comparison will depend on the database configuration. In particular, it may be either case-sensitive or case-insensitive.
This DbFunction method has no in-memory implementation and will throw if the query switches to client-evaluation. This can happen if the query contains one or more expressions that could not be translated to the store.
Applies to
Entity Framework