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 +3
-3
lines changed
src/ServiceStack.OrmLite/Expressions
tests/ServiceStack.OrmLite.VbNetTests Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1053,14 +1053,14 @@ protected virtual object VisitBinary(BinaryExpression b)
10531053 if ( right as PartialSqlString == null )
10541054 right = ( ( bool ) right ) ? GetTrueExpression ( ) : GetFalseExpression ( ) ;
10551055 }
1056- else if ( operand == "=" && b . Left is MethodCallExpression && ( ( MethodCallExpression ) b . Left ) . Method . Name == "CompareString" )
1056+ else if ( ( operand == "=" || operand == "<>" ) && b . Left is MethodCallExpression && ( ( MethodCallExpression ) b . Left ) . Method . Name == "CompareString" )
10571057 {
10581058 //Handle VB.NET converting (x => x.Name == "Foo") into (x => CompareString(x.Name, "Foo", False)
10591059 var methodExpr = ( MethodCallExpression ) b . Left ;
10601060 var args = this . VisitExpressionList ( methodExpr . Arguments ) ;
10611061 object quotedColName = args [ 0 ] ;
10621062 object value = GetValue ( args [ 1 ] , typeof ( string ) ) ;
1063- return new PartialSqlString ( "(" + quotedColName + " = " + value + ")" ) ;
1063+ return new PartialSqlString ( "({0} {1} {2})" . Fmt ( quotedColName , operand , value ) ) ;
10641064 }
10651065 else
10661066 {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Module Module1
2828
2929 Dim q As SqlExpression( Of Poco) = db.From( Of Poco)()
3030
31- q.Where( Function (x) x.Name = "Foo ")
31+ q.Where( Function (x) x.Name <> "Bar ")
3232
3333 Dim rows As List( Of Poco) = db.Select(q)
3434
You can’t perform that action at this time.
0 commit comments