File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,16 +63,16 @@ context.Items.Where(a => a.ItemId > 500).BatchDeleteAsync();
6363
6464// Update (using Expression arg.) supports Increment/Decrement
6565context .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 });
6767 // can be as value '+100' or as variable '+incrementStep' (int incrementStep = 100;)
6868
6969// Update (via simple object)
7070context .Items .Where (a => a .ItemId <= 500 ).BatchUpdate (new Item { Description = " Updated" });
7171context .Items .Where (a => a .ItemId <= 500 ).BatchUpdateAsync (new Item { Description = " Updated" });
7272// 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')
7474var 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.
7676
7777// Batch iteration (useful in same cases to avoid lock escalation)
7878do {
You can’t perform that action at this time.
0 commit comments