File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Async/Immutable/EntityWithMutableCollection
Immutable/EntityWithMutableCollection Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1235,6 +1235,8 @@ public virtual async Task OneToManyCollectionOptimisticLockingWithUpdateAsync()
1235
1235
s = OpenSession ( ) ;
1236
1236
t = s . BeginTransaction ( ) ;
1237
1237
c = await ( s . CreateCriteria < Contract > ( ) . UniqueResultAsync < Contract > ( ) ) ;
1238
+ await ( s . DeleteAsync ( c ) ) ;
1239
+
1238
1240
// If the entity uses a join mapping, DML queries require temp tables.
1239
1241
if ( Dialect . SupportsTemporaryTables )
1240
1242
await ( s . CreateQuery ( "delete from Party" ) . ExecuteUpdateAsync ( ) ) ;
@@ -1252,7 +1254,6 @@ public virtual async Task OneToManyCollectionOptimisticLockingWithUpdateAsync()
1252
1254
await ( s . DeleteAsync ( newParty ) ) ;
1253
1255
}
1254
1256
1255
- await ( s . DeleteAsync ( c ) ) ;
1256
1257
Assert . That ( await ( s . CreateCriteria < Contract > ( ) . SetProjection ( Projections . RowCountInt64 ( ) ) . UniqueResultAsync < long > ( ) ) , Is . EqualTo ( 0L ) ) ;
1257
1258
Assert . That ( await ( s . CreateCriteria < Party > ( ) . SetProjection ( Projections . RowCountInt64 ( ) ) . UniqueResultAsync < long > ( ) ) , Is . EqualTo ( 0L ) ) ;
1258
1259
await ( t . CommitAsync ( ) ) ;
Original file line number Diff line number Diff line change @@ -1224,6 +1224,8 @@ public virtual void OneToManyCollectionOptimisticLockingWithUpdate()
1224
1224
s = OpenSession ( ) ;
1225
1225
t = s . BeginTransaction ( ) ;
1226
1226
c = s . CreateCriteria < Contract > ( ) . UniqueResult < Contract > ( ) ;
1227
+ s . Delete ( c ) ;
1228
+
1227
1229
// If the entity uses a join mapping, DML queries require temp tables.
1228
1230
if ( Dialect . SupportsTemporaryTables )
1229
1231
s . CreateQuery ( "delete from Party" ) . ExecuteUpdate ( ) ;
@@ -1241,7 +1243,6 @@ public virtual void OneToManyCollectionOptimisticLockingWithUpdate()
1241
1243
s . Delete ( newParty ) ;
1242
1244
}
1243
1245
1244
- s . Delete ( c ) ;
1245
1246
Assert . That ( s . CreateCriteria < Contract > ( ) . SetProjection ( Projections . RowCountInt64 ( ) ) . UniqueResult < long > ( ) , Is . EqualTo ( 0L ) ) ;
1246
1247
Assert . That ( s . CreateCriteria < Party > ( ) . SetProjection ( Projections . RowCountInt64 ( ) ) . UniqueResult < long > ( ) , Is . EqualTo ( 0L ) ) ;
1247
1248
t . Commit ( ) ;
You can’t perform that action at this time.
0 commit comments