forked from zzzprojects/System.Linq.Dynamic.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDynamicFunctions.cs
More file actions
51 lines (49 loc) · 2.53 KB
/
DynamicFunctions.cs
File metadata and controls
51 lines (49 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System.Linq.Dynamic.Core.CustomTypeProviders;
namespace Microsoft.EntityFrameworkCore.DynamicLinq
{
/// <summary>
/// DynamicFunctions (EF.Functions)
/// </summary>
[DynamicLinqType]
public static class DynamicFunctions
{
#if NETSTANDARD2_0
/// <summary>
/// <para>
/// An implementation of the SQL LIKE operation. On relational databases this is usually directly
/// translated to SQL.
/// </para>
/// <para>
/// Note that if this function is translated into SQL, then the semantics of the comparison will
/// depend on the database configuration. In particular, it may be either case-sensitive or
/// case-insensitive. If this function is evaluated on the client, then it will always use
/// a case-insensitive comparison.
/// </para>
/// </summary>
/// <param name="matchExpression">The string that is to be matched.</param>
/// <param name="pattern">The pattern which may involve wildcards %,_,[,],^.</param>
/// <returns>true if there is a match.</returns>
public static bool Like(string matchExpression, string pattern) => EF.Functions.Like(matchExpression, pattern);
/// <summary>
/// <para>
/// An implementation of the SQL LIKE operation. On relational databases this is usually directly
/// translated to SQL.
/// </para>
/// <para>
/// Note that if this function is translated into SQL, then the semantics of the comparison will
/// depend on the database configuration. In particular, it may be either case-sensitive or
/// case-insensitive. If this function is evaluated on the client, then it will always use
/// a case-insensitive comparison.
/// </para>
/// </summary>
/// <param name="matchExpression">The string that is to be matched.</param>
/// <param name="pattern">The pattern which may involve wildcards %,_,[,],^.</param>
/// <param name="escapeCharacter">
/// The escape character (as a single character string) to use in front of %,_,[,],^
/// if they are not used as wildcards.
/// </param>
/// <returns>true if there is a match.</returns>
public static bool Like(string matchExpression, string pattern, string escapeCharacter) => EF.Functions.Like(matchExpression, pattern, escapeCharacter);
#endif
}
}