NpgsqlBulk.EFCore 0.7.7.1

Extension for Entity Framework Npgsql for Bulk Copy

There is a newer version of this package available.
See the version list below for details.
Install-Package NpgsqlBulk.EFCore -Version 0.7.7.1
dotnet add package NpgsqlBulk.EFCore --version 0.7.7.1
<PackageReference Include="NpgsqlBulk.EFCore" Version="0.7.7.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NpgsqlBulk.EFCore --version 0.7.7.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 1.5 and 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 1.5 and 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

Fix for InsertConflictAction with derived classes

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NpgsqlBulk.EFCore:

Package Downloads
YY.EventLogExportAssistant.PostgreSQL
Library for exprorting 1C:Enterprise 8.x platform's event log files to PostgreSQL database

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.8.1.1 1,003 4/18/2020
0.8.1 69 4/18/2020
0.8.0 1,070 1/18/2020
0.8.0-beta 106 1/5/2020
0.7.7.1 6,304 11/23/2019
0.7.7 210 11/14/2019
0.7.6.2 145 10/18/2019
0.7.6.1 109 10/11/2019
0.7.6 124 10/6/2019
0.7.5 331 9/29/2019
0.7.4 757 7/20/2019
0.7.3 136 7/20/2019