FlexLabs.EntityFrameworkCore.Upsert 4.0.0

Adds basic support for "Upsert" operations to EF Core.

Uses `INSERT … ON CONFLICT DO UPDATE` in PostgreSQL/Sqlite, `MERGE` in SqlServer and `INSERT INTO … ON DUPLICATE KEY UPDATE` in MySQL.

Also supports injecting sql command generators to add support for other providers

Install-Package FlexLabs.EntityFrameworkCore.Upsert -Version 4.0.0
dotnet add package FlexLabs.EntityFrameworkCore.Upsert --version 4.0.0
<PackageReference Include="FlexLabs.EntityFrameworkCore.Upsert" Version="4.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FlexLabs.EntityFrameworkCore.Upsert --version 4.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FlexLabs.EntityFrameworkCore.Upsert, 4.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install FlexLabs.EntityFrameworkCore.Upsert as a Cake Addin
#addin nuget:?package=FlexLabs.EntityFrameworkCore.Upsert&version=4.0.0

// Install FlexLabs.EntityFrameworkCore.Upsert as a Cake Tool
#tool nuget:?package=FlexLabs.EntityFrameworkCore.Upsert&version=4.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

v4.0.0
+ Adding support for .NET 5 and EF Core 5
! Patched support for constants in the update condition
! Run and RunAsync will not return all rows affected when command was split into multiple batches, not just the last batch's row count
! Patching the extension method to replace/inject custom command runner
! Removed old extension method on IServiceCollection, since it wasn't working anyway

v3.1.0
- Referencing EF Core 3.1 only, due to internal namespace changes and compatibility issues with .NET Full Framework
+ Nulable type metadata
+ Adding support for upserting by identity column
+ Splitting the request into multiple queries if the query parameter limit is reached

v3.0.0
* EF Core 3 support

v2.2.1:
+ Support for more expressions (Bitwise AND and bitwise OR)

v2.2.0:
+ Support for more expressions (AND and OR)
+ Support for default column values and expressions
+ Null value handling in generated SQL
! Patched MySQL syntax for columns that haven't been updated but may be present in expressions

NuGet packages (9)

Showing the top 5 NuGet packages that depend on FlexLabs.EntityFrameworkCore.Upsert:

Package Downloads
Elsa.Persistence.EntityFrameworkCore
Elsa is a set of workflow libraries and tools that enable super-fast workflowing capabilities in any .NET Core application. This package provides an Entity Framework Core persistence provider.
YYApp
YYApp Core
Ev2.Db.Up
Api micro service
EfConfigurationProvider.Core
Package Description
HwApp.Core
HwApp Core

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on FlexLabs.EntityFrameworkCore.Upsert:

Repository Stars
enkodellc/blazorboilerplate
Blazor Boilerplate / Starter Template with MatBlazor
Texnomic/SecureDNS
Secure, Modern, Fully-Featured, All-In-One Cross-Architecture & Cross-Platform DNS Server Using C# 8.0 & .NET Core 3.1

Version History

Version Downloads Last updated
4.0.0 20,495 3/2/2021
3.1.0 578,471 1/26/2020
3.0.0 71,704 9/29/2019
3.0.0-netcore3-00140 3,464 8/11/2019
2.2.1 51,631 9/17/2019
2.2.0 34,960 8/11/2019
2.1.2 50,447 5/22/2019
2.1.1 587 5/21/2019
2.1.0 1,062 5/19/2019
2.0.7 49,408 3/18/2019
2.0.6 9,348 2/6/2019
2.0.5 14,793 1/25/2019
2.0.4 6,261 1/3/2019
2.0.3 4,648 12/18/2018
2.0.2 8,976 11/3/2018
2.0.1 866 10/24/2018
2.0.0 7,394 9/19/2018
1.1.0 424 9/19/2018
1.0.4 9,871 3/10/2018
1.0.3 585 2/23/2018
1.0.2 488 2/20/2018
1.0.1 555 2/19/2018
1.0.0 563 2/18/2018