File tree Expand file tree Collapse file tree 1 file changed +19
-23
lines changed
src/NHibernate.Test/NHSpecificTest/GH3530 Expand file tree Collapse file tree 1 file changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,12 @@ public void FixtureTearDown()
27
27
28
28
protected override void OnTearDown ( )
29
29
{
30
- using ( var session = OpenSession ( ) )
31
- using ( var transaction = session . BeginTransaction ( ) )
32
- {
33
- session . CreateQuery ( "delete from System.Object" ) . ExecuteUpdate ( ) ;
30
+ using var session = OpenSession ( ) ;
31
+ using var transaction = session . BeginTransaction ( ) ;
34
32
35
- transaction . Commit ( ) ;
36
- }
33
+ session . CreateQuery ( "delete from System.Object" ) . ExecuteUpdate ( ) ;
34
+
35
+ transaction . Commit ( ) ;
37
36
}
38
37
39
38
protected override void CreateSchema ( )
@@ -72,24 +71,21 @@ private void CreateTable(string name)
72
71
sb . Append ( $ ", { Dialect . PrimaryKeyString } ( Id )") ;
73
72
sb . Append ( ')' ) ;
74
73
75
- using ( var cn = Sfi . ConnectionProvider . GetConnection ( ) )
74
+ using var cn = Sfi . ConnectionProvider . GetConnection ( ) ;
75
+ try
76
76
{
77
- try
78
- {
79
- using ( var cmd = cn . CreateCommand ( ) )
80
- {
81
- cmd . CommandText = sb . ToString ( ) ;
82
- cmd . ExecuteNonQuery ( ) ;
83
- }
84
- }
85
- catch ( Exception ex )
86
- {
87
- Assert . Warn ( $ "Creating the schema failed, assuming it already exists. { ex } ") ;
88
- }
89
- finally
90
- {
91
- Sfi . ConnectionProvider . CloseConnection ( cn ) ;
92
- }
77
+ using var cmd = cn . CreateCommand ( ) ;
78
+
79
+ cmd . CommandText = sb . ToString ( ) ;
80
+ cmd . ExecuteNonQuery ( ) ;
81
+ }
82
+ catch ( Exception ex )
83
+ {
84
+ Assert . Warn ( $ "Creating the schema failed, assuming it already exists. { ex } ") ;
85
+ }
86
+ finally
87
+ {
88
+ Sfi . ConnectionProvider . CloseConnection ( cn ) ;
93
89
}
94
90
}
95
91
You can’t perform that action at this time.
0 commit comments