This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
ServiceStack.OrmLite.SqlServerTests
ServiceStack.OrmLite/Expressions
tests/ServiceStack.OrmLite.Tests Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -107,14 +107,15 @@ public void test_if_and_works_with_nullable_parameter()
107
107
db . CreateTable < TestEntity > ( true ) ;
108
108
db . Insert ( new TestEntity
109
109
{
110
- Id = 2000 ,
111
110
Foo = this . RandomString ( 16 ) ,
112
111
Bar = this . RandomString ( 16 ) ,
113
112
Baz = this . RandomDecimal ( )
114
113
} ) ;
115
114
115
+ var id = ( int ) db . GetLastInsertId ( ) ;
116
+
116
117
var ev = OrmLiteConfig . DialectProvider . ExpressionVisitor < TestEntity > ( ) ;
117
- ev . Where ( e => e . Id == 2000 ) ;
118
+ ev . Where ( e => e . Id == id ) ;
118
119
int ? i = null ;
119
120
ev . And ( e => e . NullInt == i ) ;
120
121
Original file line number Diff line number Diff line change @@ -737,8 +737,8 @@ protected virtual object VisitBinary(BinaryExpression b)
737
737
738
738
}
739
739
740
- if ( operand == "=" && right . ToString ( ) == "null" ) operand = "is" ;
741
- else if ( operand == "<>" && right . ToString ( ) == "null" ) operand = "is not" ;
740
+ if ( operand == "=" && right . ToString ( ) . Equals ( "null" , StringComparison . InvariantCultureIgnoreCase ) ) operand = "is" ;
741
+ else if ( operand == "<>" && right . ToString ( ) . Equals ( "null" , StringComparison . InvariantCultureIgnoreCase ) ) operand = "is not" ;
742
742
743
743
switch ( operand )
744
744
{
Original file line number Diff line number Diff line change @@ -11,6 +11,15 @@ public void Setup()
11
11
{
12
12
using ( var dbConn = ConnectionString . OpenDbConnection ( ) )
13
13
{
14
+ dbConn . DropTable < TypeWithOnDeleteAndUpdateCascade > ( ) ;
15
+ dbConn . DropTable < TypeWithOnDeleteSetNull > ( ) ;
16
+ dbConn . DropTable < TypeWithOnDeleteSetDefault > ( ) ;
17
+ dbConn . DropTable < TypeWithOnDeleteRestrict > ( ) ;
18
+ dbConn . DropTable < TypeWithOnDeleteNoAction > ( ) ;
19
+ dbConn . DropTable < TypeWithOnDeleteCascade > ( ) ;
20
+ dbConn . DropTable < TypeWithSimpleForeignKey > ( ) ;
21
+ dbConn . DropTable < ReferencedType > ( ) ;
22
+
14
23
dbConn . DropAndCreateTable < ReferencedType > ( ) ;
15
24
}
16
25
}
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ public class Config
14
14
public static string SqliteFileDir = "~/App_Data/" . MapAbsolutePath ( ) ;
15
15
public static string SqliteFileDb = "~/App_Data/db.sqlite" . MapAbsolutePath ( ) ;
16
16
public static string SqlServerDb = "~/App_Data/Database1.mdf" . MapAbsolutePath ( ) ;
17
- public static string SqlServerBuildDb = "Server=pc;Database=test;User Id=pc;Password=pc;" ;
17
+ //public static string SqlServerBuildDb = "Server=pc;Database=test;User Id=pc;Password=pc;";
18
+ public static string SqlServerBuildDb = "Data Source=localhost;Initial Catalog=TestDb;Integrated Security=SSPI;Connect Timeout=120;MultipleActiveResultSets=True" ;
18
19
19
20
public static IOrmLiteDialectProvider DefaultProvider = SqlServerDialect . Provider ;
20
21
public static string DefaultConnection = SqlServerBuildDb ;
You can’t perform that action at this time.
0 commit comments