This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
tests/ServiceStack.OrmLite.Tests/Issues Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change 1- using System . Linq ;
1+ using System ;
2+ using System . Linq ;
23using NUnit . Framework ;
34using ServiceStack . DataAnnotations ;
45using ServiceStack . Model ;
@@ -29,21 +30,26 @@ public void Dont_guess_column_in_mismatched_Into_model()
2930 {
3031 OrmLiteConfig . DisableColumnGuessFallback = true ;
3132
32- using ( var db = OpenDbConnection ( ) )
33+ try
3334 {
34- db . DropAndCreateTable < DbPoco > ( ) ;
35+ using ( var db = OpenDbConnection ( ) )
36+ {
37+ db . DropAndCreateTable < DbPoco > ( ) ;
3538
36- db . Insert ( new DbPoco { Id = "1" , Other_Id = "OTHER" } ) ;
39+ db . Insert ( new DbPoco { Id = "1" , Other_Id = "OTHER" } ) ;
3740
38- var row = db . Select < DTOPoco > ( db . From < DbPoco > ( ) ) . First ( ) ;
41+ var row = db . Select < DTOPoco > ( db . From < DbPoco > ( ) ) . First ( ) ;
3942
40- row . PrintDump ( ) ;
43+ row . PrintDump ( ) ;
4144
42- Assert . That ( row . _Id , Is . Null ) ;
43- Assert . That ( row . Other_Id , Is . EqualTo ( "OTHER" ) ) ;
45+ Assert . That ( row . _Id , Is . Null ) ;
46+ Assert . That ( row . Other_Id , Is . EqualTo ( "OTHER" ) ) ;
47+ }
48+ }
49+ finally
50+ {
51+ OrmLiteConfig . DisableColumnGuessFallback = false ;
4452 }
45-
46- OrmLiteConfig . DisableColumnGuessFallback = false ;
4753 }
4854 }
4955}
You can’t perform that action at this time.
0 commit comments