NpgsqlBulk.EFCore 0.8.1.1

Extension for Entity Framework Npgsql for Bulk Copy

Install-Package NpgsqlBulk.EFCore -Version 0.8.1.1
dotnet add package NpgsqlBulk.EFCore --version 0.8.1.1
<PackageReference Include="NpgsqlBulk.EFCore" Version="0.8.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NpgsqlBulk.EFCore --version 0.8.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Npgsql.Bulk

Helper for performing COPY (bulk insert and update) operation easily, using Entity Framework + Npgsql.

.Net 4.5, Standard 2.0 are supported.

var uploader = new NpgsqlBulkUploader(context);
var data = GetALotOfData();

// To create a lot of objects
uploader.Insert(data);

// To update a lot of objects
uploader.Update(data);

For .Net 4.5 BulkSelect operation is implemented which emulates join in-memory table to DB table. Here is the example:

// We need DbContext first
var context = GetContext();                 

// Obtained a collection of 50k transactions
var transactions = GetListOfTransction();   

// Need to get prices from DB for all transactions, do it with 1 SQL call
var prices = context.Prices.BulkSelect(
    x => new { x.Ticker, x.TradedOn },                      // need to specify key for JOIN
    transactions.Select(x => new { x.Ticker, x.TradedOn })  // obtain key data from local objects
);

// Done, prices variable now contains List<Price> which matches the JOIN DB table to in-memory collection

Npgsql.Bulk

Helper for performing COPY (bulk insert and update) operation easily, using Entity Framework + Npgsql.

.Net 4.5, Standard 2.0 are supported.

var uploader = new NpgsqlBulkUploader(context);
var data = GetALotOfData();

// To create a lot of objects
uploader.Insert(data);

// To update a lot of objects
uploader.Update(data);

For .Net 4.5 BulkSelect operation is implemented which emulates join in-memory table to DB table. Here is the example:

// We need DbContext first
var context = GetContext();                 

// Obtained a collection of 50k transactions
var transactions = GetListOfTransction();   

// Need to get prices from DB for all transactions, do it with 1 SQL call
var prices = context.Prices.BulkSelect(
    x => new { x.Ticker, x.TradedOn },                      // need to specify key for JOIN
    transactions.Select(x => new { x.Ticker, x.TradedOn })  // obtain key data from local objects
);

// Done, prices variable now contains List<Price> which matches the JOIN DB table to in-memory collection

Release Notes

Tiny bugs fixes

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.8.1.1 691 4/18/2020
0.8.1 61 4/18/2020
0.8.0 1,059 1/18/2020
0.8.0-beta 104 1/5/2020
0.7.7.1 6,088 11/23/2019
0.7.7 203 11/14/2019
0.7.6.2 141 10/18/2019
0.7.6.1 105 10/11/2019
0.7.6 120 10/6/2019
0.7.5 291 9/29/2019
0.7.4 729 7/20/2019
0.7.3 130 7/20/2019