File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -63,16 +63,16 @@ context.Items.Where(a => a.ItemId > 500).BatchDeleteAsync();
63
63
64
64
// Update (using Expression arg.) supports Increment/Decrement
65
65
context .Items .Where (a => a .ItemId <= 500 ).BatchUpdate (a => new Item { Quantity = a .Quantity + 100 });
66
- context .Items .Where (a => a .ItemId <= 500 ).BatchUpdateAsync (a => new Item { Quantity = a .Quantity + 100 });
66
+ context .Items .Where (a => a .ItemId <= 500 ).BatchUpdateAsync (a => new Item { Quantity = a .Quantity + 100 });
67
67
// can be as value '+100' or as variable '+incrementStep' (int incrementStep = 100;)
68
68
69
69
// Update (via simple object)
70
70
context .Items .Where (a => a .ItemId <= 500 ).BatchUpdate (new Item { Description = " Updated" });
71
71
context .Items .Where (a => a .ItemId <= 500 ).BatchUpdateAsync (new Item { Description = " Updated" });
72
72
// Update (via simple object) - requires additional Argument for setting to Property default value
73
- var updateCols = new List <string > { nameof (Item .Quantity ) }; // Update 'Quantity' to default value('0'-zero )
73
+ var updateCols = new List <string > { nameof (Item .Quantity ) }; // Update 'Quantity' to default value ('0')
74
74
var q = context .Items .Where (a => a .ItemId <= 500 );
75
- int affected = q .BatchUpdate (new Item { Description = " Updated" }, updateCols ); // result assigned to variable
75
+ int affected = q .BatchUpdate (new Item { Description = " Updated" }, updateCols ); // result assigned to aff.
76
76
77
77
// Batch iteration (useful in same cases to avoid lock escalation)
78
78
do {
You can’t perform that action at this time.
0 commit comments