@@ -261,7 +261,7 @@ public async Task SimpleInsertWithConstantsAsync()
261
261
var count = await ( s
262
262
. Query < Car > ( )
263
263
. InsertBuilder ( ) . Into < Pickup > ( ) . Value ( y => y . Id , y => - y . Id ) . Value ( y => y . Vin , y => y . Vin ) . Value ( y => y . Owner , "The owner" )
264
- . InsertAsync ( CancellationToken . None ) ) ;
264
+ . InsertAsync ( ) ) ;
265
265
Assert . AreEqual ( 1 , count ) ;
266
266
267
267
await ( t . CommitAsync ( ) ) ;
@@ -278,7 +278,7 @@ public async Task SimpleInsertFromProjectionAsync()
278
278
. Query < Car > ( )
279
279
. Select ( x => new { x . Id , x . Owner , UpperOwner = x . Owner . ToUpper ( ) } )
280
280
. InsertBuilder ( ) . Into < Pickup > ( ) . Value ( y => y . Id , y => - y . Id ) . Value ( y => y . Vin , y => y . UpperOwner )
281
- . InsertAsync ( CancellationToken . None ) ) ;
281
+ . InsertAsync ( ) ) ;
282
282
Assert . AreEqual ( 1 , count ) ;
283
283
284
284
await ( t . CommitAsync ( ) ) ;
@@ -497,7 +497,7 @@ public async Task InsertToComponentAsync()
497
497
// https://firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-dml-insert.html#fblangref25-dml-insert-select-unstable
498
498
. Where ( sc => sc . Name . First != correctName )
499
499
. InsertBuilder ( ) . Into < SimpleClassWithComponent > ( ) . Value ( y => y . Name . First , y => correctName )
500
- . InsertAsync ( CancellationToken . None ) ) ;
500
+ . InsertAsync ( ) ) ;
501
501
Assert . That ( count , Is . EqualTo ( 1 ) , "incorrect insert count from individual setters" ) ;
502
502
503
503
count = s
@@ -552,7 +552,7 @@ public async Task UpdateWithWhereExistsSubqueryAsync()
552
552
. Query < Human > ( )
553
553
. Where ( x => x . Friends . OfType < Human > ( ) . Any ( f => f . Name . Last == "Public" ) )
554
554
. UpdateBuilder ( ) . Set ( y => y . Description , "updated" )
555
- . UpdateAsync ( CancellationToken . None ) ) ;
555
+ . UpdateAsync ( ) ) ;
556
556
Assert . That ( count , Is . EqualTo ( 1 ) ) ;
557
557
await ( t . CommitAsync ( ) ) ;
558
558
}
@@ -566,7 +566,7 @@ public async Task UpdateWithWhereExistsSubqueryAsync()
566
566
. Query < SimpleEntityWithAssociation > ( )
567
567
. Where ( x => x . AssociatedEntities . Any ( a => a . Name == "one-to-many-association" ) )
568
568
. UpdateBuilder ( ) . Set ( y => y . Name , "updated" )
569
- . UpdateAsync ( CancellationToken . None ) ) ;
569
+ . UpdateAsync ( ) ) ;
570
570
Assert . That ( count , Is . EqualTo ( 1 ) ) ;
571
571
// many-to-many test
572
572
if ( Dialect . SupportsSubqueryOnMutatingTable )
@@ -575,7 +575,7 @@ public async Task UpdateWithWhereExistsSubqueryAsync()
575
575
. Query < SimpleEntityWithAssociation > ( )
576
576
. Where ( x => x . ManyToManyAssociatedEntities . Any ( a => a . Name == "many-to-many-association" ) )
577
577
. UpdateBuilder ( ) . Set ( y => y . Name , "updated" )
578
- . UpdateAsync ( CancellationToken . None ) ) ;
578
+ . UpdateAsync ( ) ) ;
579
579
580
580
Assert . That ( count , Is . EqualTo ( 1 ) ) ;
581
581
}
@@ -596,7 +596,7 @@ public async Task IncrementCounterVersionAsync()
596
596
var count = await ( s
597
597
. Query < IntegerVersioned > ( )
598
598
. UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name + "upd" ) . Set ( y => y . Data , y => y . Data + "upd" )
599
- . UpdateVersionedAsync ( CancellationToken . None ) ) ;
599
+ . UpdateVersionedAsync ( ) ) ;
600
600
Assert . That ( count , Is . EqualTo ( 1 ) , "incorrect exec count" ) ;
601
601
await ( t . CommitAsync ( ) ) ;
602
602
}
@@ -627,7 +627,7 @@ public async Task IncrementTimestampVersionAsync()
627
627
var count = await ( s
628
628
. Query < TimestampVersioned > ( )
629
629
. UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name + "upd" ) . Set ( y => y . Data , y => y . Data + "upd" )
630
- . UpdateVersionedAsync ( CancellationToken . None ) ) ;
630
+ . UpdateVersionedAsync ( ) ) ;
631
631
Assert . That ( count , Is . EqualTo ( 1 ) , "incorrect exec count" ) ;
632
632
await ( t . CommitAsync ( ) ) ;
633
633
}
@@ -700,12 +700,12 @@ public async Task UpdateOnManyToOneAsync()
700
700
using ( var s = OpenSession ( ) )
701
701
using ( var t = s . BeginTransaction ( ) )
702
702
{
703
- Assert . DoesNotThrowAsync ( ( ) => { return s . Query < Animal > ( ) . Where ( x => x . Id == 2 ) . UpdateBuilder ( ) . Set ( y => y . Mother , y => null ) . UpdateAsync ( CancellationToken . None ) ; } ) ;
703
+ Assert . DoesNotThrowAsync ( ( ) => { return s . Query < Animal > ( ) . Where ( x => x . Id == 2 ) . UpdateBuilder ( ) . Set ( y => y . Mother , y => null ) . UpdateAsync ( ) ; } ) ;
704
704
705
705
if ( Dialect . SupportsSubqueryOnMutatingTable )
706
706
{
707
707
Assert . DoesNotThrowAsync (
708
- ( ) => { return s . Query < Animal > ( ) . Where ( x => x . Id == 2 ) . UpdateBuilder ( ) . Set ( y => y . Mother , y => s . Query < Animal > ( ) . First ( z => z . Id == 1 ) ) . UpdateAsync ( CancellationToken . None ) ; } ) ;
708
+ ( ) => { return s . Query < Animal > ( ) . Where ( x => x . Id == 2 ) . UpdateBuilder ( ) . Set ( y => y . Mother , y => s . Query < Animal > ( ) . First ( z => z . Id == 1 ) ) . UpdateAsync ( ) ; } ) ;
709
709
}
710
710
711
711
await ( t . CommitAsync ( ) ) ;
@@ -719,22 +719,22 @@ public async Task UpdateOnDiscriminatorSubclassAsync()
719
719
{
720
720
using ( var t = s . BeginTransaction ( ) )
721
721
{
722
- var count = await ( s . Query < PettingZoo > ( ) . UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name ) . UpdateAsync ( CancellationToken . None ) ) ;
722
+ var count = await ( s . Query < PettingZoo > ( ) . UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name ) . UpdateAsync ( ) ) ;
723
723
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect discrim subclass update count" ) ;
724
724
725
725
await ( t . RollbackAsync ( ) ) ;
726
726
}
727
727
using ( var t = s . BeginTransaction ( ) )
728
728
{
729
- var count = await ( s . Query < PettingZoo > ( ) . Where ( x => x . Id == _pettingZoo . Id ) . UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name ) . UpdateAsync ( CancellationToken . None ) ) ;
729
+ var count = await ( s . Query < PettingZoo > ( ) . Where ( x => x . Id == _pettingZoo . Id ) . UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name ) . UpdateAsync ( ) ) ;
730
730
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect discrim subclass update count" ) ;
731
731
732
732
await ( t . RollbackAsync ( ) ) ;
733
733
}
734
734
using ( var t = s . BeginTransaction ( ) )
735
735
{
736
736
737
- var count = await ( s . Query < Zoo > ( ) . UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name ) . UpdateAsync ( CancellationToken . None ) ) ;
737
+ var count = await ( s . Query < Zoo > ( ) . UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name ) . UpdateAsync ( ) ) ;
738
738
Assert . That ( count , Is . EqualTo ( 2 ) , "Incorrect discrim subclass update count" ) ;
739
739
740
740
await ( t . RollbackAsync ( ) ) ;
@@ -743,7 +743,7 @@ public async Task UpdateOnDiscriminatorSubclassAsync()
743
743
{
744
744
// TODO : not so sure this should be allowed. Seems to me that if they specify an alias,
745
745
// property-refs should be required to be qualified.
746
- var count = await ( s . Query < Zoo > ( ) . Where ( x => x . Id == _zoo . Id ) . UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name ) . UpdateAsync ( CancellationToken . None ) ) ;
746
+ var count = await ( s . Query < Zoo > ( ) . Where ( x => x . Id == _zoo . Id ) . UpdateBuilder ( ) . Set ( y => y . Name , y => y . Name ) . UpdateAsync ( ) ) ;
747
747
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect discrim subclass update count" ) ;
748
748
749
749
await ( t . CommitAsync ( ) ) ;
@@ -766,25 +766,25 @@ public async Task UpdateOnAnimalAsync()
766
766
//Assert.That(count, Is.EqualTo(1), "Incorrect entity-updated count");
767
767
768
768
var count =
769
- await ( s . Query < Animal > ( ) . Where ( x => x . Description == _polliwog . Description ) . UpdateBuilder ( ) . Set ( y => y . Description , y => "Tadpole" ) . UpdateAsync ( CancellationToken . None ) ) ;
769
+ await ( s . Query < Animal > ( ) . Where ( x => x . Description == _polliwog . Description ) . UpdateBuilder ( ) . Set ( y => y . Description , y => "Tadpole" ) . UpdateAsync ( ) ) ;
770
770
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect entity-updated count" ) ;
771
771
772
772
var tadpole = await ( s . LoadAsync < Animal > ( _polliwog . Id ) ) ;
773
773
774
774
Assert . That ( tadpole . Description , Is . EqualTo ( "Tadpole" ) , "Update did not take effect" ) ;
775
775
776
776
count =
777
- await ( s . Query < Dragon > ( ) . UpdateBuilder ( ) . Set ( y => y . FireTemperature , 300 ) . UpdateAsync ( CancellationToken . None ) ) ;
777
+ await ( s . Query < Dragon > ( ) . UpdateBuilder ( ) . Set ( y => y . FireTemperature , 300 ) . UpdateAsync ( ) ) ;
778
778
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect entity-updated count" ) ;
779
779
780
780
781
781
count =
782
- await ( s . Query < Animal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , y => y . BodyWeight + 1 + 1 ) . UpdateAsync ( CancellationToken . None ) ) ;
782
+ await ( s . Query < Animal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , y => y . BodyWeight + 1 + 1 ) . UpdateAsync ( ) ) ;
783
783
Assert . That ( count , Is . EqualTo ( 10 ) , "incorrect count on 'complex' update assignment" ) ;
784
784
785
785
if ( Dialect . SupportsSubqueryOnMutatingTable )
786
786
{
787
- Assert . DoesNotThrowAsync ( ( ) => { return s . Query < Animal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , y => s . Query < Animal > ( ) . Max ( z => z . BodyWeight ) ) . UpdateAsync ( CancellationToken . None ) ; } ) ;
787
+ Assert . DoesNotThrowAsync ( ( ) => { return s . Query < Animal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , y => s . Query < Animal > ( ) . Max ( z => z . BodyWeight ) ) . UpdateAsync ( ) ; } ) ;
788
788
}
789
789
790
790
await ( t . CommitAsync ( ) ) ;
@@ -803,7 +803,7 @@ public async Task UpdateOnDragonWithProtectedPropertyAsync()
803
803
using ( var t = s . BeginTransaction ( ) )
804
804
{
805
805
var count =
806
- await ( s . Query < Dragon > ( ) . UpdateBuilder ( ) . Set ( y => y . FireTemperature , 300 ) . UpdateAsync ( CancellationToken . None ) ) ;
806
+ await ( s . Query < Dragon > ( ) . UpdateBuilder ( ) . Set ( y => y . FireTemperature , 300 ) . UpdateAsync ( ) ) ;
807
807
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect entity-updated count" ) ;
808
808
809
809
await ( t . CommitAsync ( ) ) ;
@@ -824,7 +824,7 @@ public async Task UpdateMultiplePropertyOnAnimalAsync()
824
824
var count =
825
825
await ( s . Query < Animal > ( )
826
826
. Where ( x => x . Description == _polliwog . Description )
827
- . UpdateBuilder ( ) . Set ( y => y . Description , y => "Tadpole" ) . Set ( y => y . BodyWeight , 3 ) . UpdateAsync ( CancellationToken . None ) ) ;
827
+ . UpdateBuilder ( ) . Set ( y => y . Description , y => "Tadpole" ) . Set ( y => y . BodyWeight , 3 ) . UpdateAsync ( ) ) ;
828
828
829
829
Assert . That ( count , Is . EqualTo ( 1 ) ) ;
830
830
await ( t . CommitAsync ( ) ) ;
@@ -850,16 +850,16 @@ public async Task UpdateOnMammalAsync()
850
850
using ( var s = OpenSession ( ) )
851
851
using ( var t = s . BeginTransaction ( ) )
852
852
{
853
- var count = await ( s . Query < Mammal > ( ) . UpdateBuilder ( ) . Set ( y => y . Description , y => y . Description ) . UpdateAsync ( CancellationToken . None ) ) ;
853
+ var count = await ( s . Query < Mammal > ( ) . UpdateBuilder ( ) . Set ( y => y . Description , y => y . Description ) . UpdateAsync ( ) ) ;
854
854
855
855
Assert . That ( count , Is . EqualTo ( 5 ) , "incorrect update count against 'middle' of joined-subclass hierarchy" ) ;
856
856
857
- count = await ( s . Query < Mammal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , 25 ) . UpdateAsync ( CancellationToken . None ) ) ;
857
+ count = await ( s . Query < Mammal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , 25 ) . UpdateAsync ( ) ) ;
858
858
Assert . That ( count , Is . EqualTo ( 5 ) , "incorrect update count against 'middle' of joined-subclass hierarchy" ) ;
859
859
860
860
if ( Dialect . SupportsSubqueryOnMutatingTable )
861
861
{
862
- count = await ( s . Query < Mammal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , y => s . Query < Animal > ( ) . Max ( z => z . BodyWeight ) ) . UpdateAsync ( CancellationToken . None ) ) ;
862
+ count = await ( s . Query < Mammal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , y => s . Query < Animal > ( ) . Max ( z => z . BodyWeight ) ) . UpdateAsync ( ) ) ;
863
863
Assert . That ( count , Is . EqualTo ( 5 ) , "incorrect update count against 'middle' of joined-subclass hierarchy" ) ;
864
864
}
865
865
@@ -879,9 +879,9 @@ public async Task UpdateSetNullUnionSubclassAsync()
879
879
using ( var s = OpenSession ( ) )
880
880
using ( var t = s . BeginTransaction ( ) )
881
881
{
882
- var count = await ( s . Query < Vehicle > ( ) . UpdateBuilder ( ) . Set ( y => y . Owner , "Steve" ) . UpdateAsync ( CancellationToken . None ) ) ;
882
+ var count = await ( s . Query < Vehicle > ( ) . UpdateBuilder ( ) . Set ( y => y . Owner , "Steve" ) . UpdateAsync ( ) ) ;
883
883
Assert . That ( count , Is . EqualTo ( 4 ) , "incorrect restricted update count" ) ;
884
- count = await ( s . Query < Vehicle > ( ) . Where ( x => x . Owner == "Steve" ) . UpdateBuilder ( ) . Set ( y => y . Owner , default ( string ) ) . UpdateAsync ( CancellationToken . None ) ) ;
884
+ count = await ( s . Query < Vehicle > ( ) . Where ( x => x . Owner == "Steve" ) . UpdateBuilder ( ) . Set ( y => y . Owner , default ( string ) ) . UpdateAsync ( ) ) ;
885
885
Assert . That ( count , Is . EqualTo ( 4 ) , "incorrect restricted update count" ) ;
886
886
887
887
count = await ( s . CreateQuery ( "delete Vehicle where Owner is null" ) . ExecuteUpdateAsync ( ) ) ;
@@ -897,13 +897,13 @@ public async Task UpdateSetNullOnDiscriminatorSubclassAsync()
897
897
using ( var s = OpenSession ( ) )
898
898
using ( var t = s . BeginTransaction ( ) )
899
899
{
900
- var count = await ( s . Query < PettingZoo > ( ) . UpdateBuilder ( ) . Set ( y => y . Address . City , default ( string ) ) . UpdateAsync ( CancellationToken . None ) ) ;
900
+ var count = await ( s . Query < PettingZoo > ( ) . UpdateBuilder ( ) . Set ( y => y . Address . City , default ( string ) ) . UpdateAsync ( ) ) ;
901
901
902
902
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect discrim subclass delete count" ) ;
903
903
count = await ( s . CreateQuery ( "delete Zoo where Address.City is null" ) . ExecuteUpdateAsync ( ) ) ;
904
904
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect discrim subclass delete count" ) ;
905
905
906
- count = await ( s . Query < Zoo > ( ) . UpdateBuilder ( ) . Set ( y => y . Address . City , default ( string ) ) . UpdateAsync ( CancellationToken . None ) ) ;
906
+ count = await ( s . Query < Zoo > ( ) . UpdateBuilder ( ) . Set ( y => y . Address . City , default ( string ) ) . UpdateAsync ( ) ) ;
907
907
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect discrim subclass delete count" ) ;
908
908
count = await ( s . CreateQuery ( "delete Zoo where Address.City is null" ) . ExecuteUpdateAsync ( ) ) ;
909
909
Assert . That ( count , Is . EqualTo ( 1 ) , "Incorrect discrim subclass delete count" ) ;
@@ -923,7 +923,7 @@ public async Task UpdateSetNullOnJoinedSubclassAsync()
923
923
using ( var s = OpenSession ( ) )
924
924
using ( var t = s . BeginTransaction ( ) )
925
925
{
926
- var count = await ( s . Query < Mammal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , - 1 ) . UpdateAsync ( CancellationToken . None ) ) ;
926
+ var count = await ( s . Query < Mammal > ( ) . UpdateBuilder ( ) . Set ( y => y . BodyWeight , - 1 ) . UpdateAsync ( ) ) ;
927
927
Assert . That ( count , Is . EqualTo ( 5 ) , "Incorrect update count on joined subclass" ) ;
928
928
929
929
count = await ( s . Query < Mammal > ( ) . CountAsync ( m => m . BodyWeight > - 1.0001 && m . BodyWeight < - 0.9999 ) ) ;
0 commit comments