Skip to content

Commit 38d28d8

Browse files
committed
SqlMethods.cs. NH-3437 Allow using SqlMethods.Like() as an extension method.
1 parent 723dd27 commit 38d28d8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/NHibernate/Linq/SqlMethods.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ public static class SqlMethods
66
{
77
/// <summary>
88
/// Use the SqlMethods.Like() method in a Linq2NHibernate expression to generate
9-
/// an SQL LIKE expression. (Any 2-argument method named Like in a class named SqlMethods
10-
/// will be translated.)
9+
/// an SQL LIKE expression. (If you want to avoid depending on the NHibernate.Linq namespace,
10+
/// you can define your own replica of this method. Any 2-argument method named Like in a class named SqlMethods
11+
/// will be translated.) This method can only be used in Linq2NHibernate expression, and will throw
12+
/// if called directly.
1113
/// </summary>
12-
public static bool Like(string matchExpression, string pattern)
14+
public static bool Like(this string matchExpression, string sqlLikePattern)
1315
{
1416
throw new NotSupportedException(
1517
"The NHibernate.Linq.SqlMethods.Like(string, string) method can only be used in Linq2NHibernate expressions.");

0 commit comments

Comments
 (0)