Skip to content

Commit

Permalink
EFCore 3 docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
borisdj authored Oct 4, 2019
1 parent 49920ca commit 9983ebb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
EntityFrameworkCore extensions: Bulk operations (**Insert, Update, Delete, Read, Upsert, Sync**) and Batch (**Delete, Update**).<br>
Library is Lightweight and very Efficient, having all mostly used CRUD operation.<br>
Was selected in top 20 [EF Core Extensions](https://docs.microsoft.com/en-us/ef/core/extensions/) recommended by Microsoft.<br>
It is targeting NetStandard 2.0 so it can be used on project targeting NetCore(2.0+) or NetFramework(4.6.1+).<br>
Current version is using EF Core 2.2 and at the moment supports Microsoft SQL Server(2008+) and SQLite.<br>
It is targeting NetStandard 2.1 so it can be used on project targeting NetCore(3.0+).<br>
Current version is using EF Core 3 and at the moment supports Microsoft SQL Server(2008+) and SQLite.<br>
Versions before 3.0, last being 2.6.3, are targeting NetStandard 2.0 and can be used with NetCore(2.0+) or NetFramework(4.6.1+).<br>
EFCore/v.Nuget: EFCore2.1/v2.4.1 EFCore2.0/v2.0.8, and for EF Core 1.x use 1.1.0 (targeting NetStandard 1.4)<br>
Under the hood uses [SqlBulkCopy](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx) for Insert, for Update/Delete combines BulkInsert with raw Sql [MERGE](https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql).<br>
For SQLite there is no BulkCopy, instead library uses plain SQL combined with [UPSERT](https://www.sqlite.org/lang_UPSERT.html).<br>
Expand Down Expand Up @@ -43,7 +44,12 @@ context.Items.Where(a => a.ItemId > 500).BatchDeleteAsync();

// Update (using Expression arg.) supports Increment/Decrement
context.Items.Where(a => a.ItemId <= 500).BatchUpdate(a => new Item { Quantity = a.Quantity + 100 });
// can be as value '+100' or as variable '+incrementStep'(int incrementStep = 100;)
// can be as value '+100' or as variable '+incrementStep' (int incrementStep = 100;)
// IMPORTANT: When using parameterized Query BatchOperation currently requires argument 'parametersDict'
int itemId = 500;
var parametersDict = new Dictionary<string, object> { { nameof(itemId), itemId } };
var query = context.Items.Where(a => a.ItemId <= itemId);
query.BatchUpdate(a => new Item { Quantity = a.Quantity + 100 }, parametersDict);

// Update (via simple object)
context.Items.Where(a => a.ItemId <= 500).BatchUpdate(new Item { Description = "Updated" });
Expand Down

0 comments on commit 9983ebb

Please sign in to comment.