This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
src/ServiceStack.OrmLite/Expressions
tests/ServiceStack.OrmLite.Tests/Expression Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -2660,6 +2660,9 @@ protected virtual object VisitColumnAccessMethod(MethodCallExpression m)
2660
2660
case "ToLower" :
2661
2661
statement = $ "lower({ quotedColName } )";
2662
2662
break ;
2663
+ case "Equals" :
2664
+ statement = $ "{ quotedColName } ={ ConvertToParam ( wildcardArg ) } ";
2665
+ break ;
2663
2666
case "StartsWith" :
2664
2667
statement = ! OrmLiteConfig . StripUpperInLike
2665
2668
? $ "upper({ quotedColName } ) like { ConvertToParam ( wildcardArg . ToUpper ( ) + "%" ) } { escapeSuffix } "
Original file line number Diff line number Diff line change @@ -196,6 +196,30 @@ public void Can_select_using_startsWith_with_backtick_in_string()
196
196
}
197
197
}
198
198
199
+ [ Test ]
200
+ public void Can_select_using_Equals ( )
201
+ {
202
+ var postfix = "postfix" ;
203
+
204
+ var expected = new TestType ( )
205
+ {
206
+ IntColumn = 7 ,
207
+ BoolColumn = true ,
208
+ StringColumn = postfix
209
+ } ;
210
+
211
+ Init ( 10 , expected ) ;
212
+
213
+ using ( var db = OpenDbConnection ( ) )
214
+ {
215
+ var actual = db . Select < TestType > ( q => q . StringColumn . Equals ( postfix ) ) ;
216
+
217
+ Assert . IsNotNull ( actual ) ;
218
+ Assert . AreEqual ( 1 , actual . Count ) ;
219
+ CollectionAssert . Contains ( actual , expected ) ;
220
+ }
221
+ }
222
+
199
223
[ Test ]
200
224
public void Can_select_using_endsWith ( )
201
225
{
You can’t perform that action at this time.
0 commit comments