EFCore.ReturningExtensions.SqlServer
11.0.1
dotnet add package EFCore.ReturningExtensions.SqlServer --version 11.0.1
NuGet\Install-Package EFCore.ReturningExtensions.SqlServer -Version 11.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EFCore.ReturningExtensions.SqlServer" Version="11.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EFCore.ReturningExtensions.SqlServer" Version="11.0.1" />
<PackageReference Include="EFCore.ReturningExtensions.SqlServer" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EFCore.ReturningExtensions.SqlServer --version 11.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EFCore.ReturningExtensions.SqlServer, 11.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EFCore.ReturningExtensions.SqlServer@11.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EFCore.ReturningExtensions.SqlServer&version=11.0.1
#tool nuget:?package=EFCore.ReturningExtensions.SqlServer&version=11.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EF Core Returning Extensions
Features
- 🚀 Single Round Trip - Retrieve affected rows without additional SELECT queries
Installation
.NET CLI
dotnet add package EFCore.ReturningExtensions.SqlServer
Usage
Configure
public class ItemsDbContext(DbContextOptions<ItemsDbContext> options) : DbContext(options)
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(connectionString, o =>
{
o.UseReturningExtensions();
});
}
}
Update
To get updated
var updatedItems = dbContext.Items
.AsNoTracking()
.Where(x => x.Name.Length < 100)
.Updated(s => s.SetProperty(p => p.Name, p => p.Name + "_suffix"), x => x)
.ToList();
or to get previous values
var previousItems = dbContext.Items
.AsNoTracking()
.Where(x => x.Name.Length < 100)
.Updated(s => s.SetProperty(p => p.Name, p => p.Name + "_suffix"), (x, y) => y)
.ToList();
or to get mixed values
var itemChanges = dbContext.Items
.AsNoTracking()
.Where(x => x.Name.Length < 100)
.Updated(s => s.SetProperty(p => p.Name, p => p.Name + "_suffix"), (x, y) => new { Change = y.Name + "|>" + x.Name })
.ToList();
Delete
var deletedItems = dbContext.Items
.AsNoTracking()
.Where(x => x.Name.Length < 100)
.Deleted(x => x)
.ToList();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net11.0
- EFCore.ReturningExtensions (>= 11.0.1)
- Microsoft.EntityFrameworkCore.SqlServer (>= 11.0.0 && < 12.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 11.0.1 | 105 | 11/10/2026 | |
| 10.2.5 | 87 | 11/18/2026 | |
| 10.2.4 | 104 | 11/10/2026 | |
| 10.2.3 | 134 | 11/5/2026 | |
| 10.2.2 | 134 | 11/3/2026 | |
| 10.2.1 | 139 | 10/28/2026 | |
| 10.2.0 | 119 | 10/20/2026 | |
| 9.2.5 | 97 | 11/18/2026 | |
| 9.2.4 | 95 | 11/10/2026 | |
| 9.2.3 | 118 | 11/5/2026 | |
| 9.2.2 | 113 | 11/3/2026 | |
| 9.2.1 | 116 | 10/28/2026 | |
| 9.2.0 | 134 | 10/20/2026 | |
| 8.2.5 | 93 | 11/18/2026 | |
| 8.2.4 | 97 | 11/10/2026 | |
| 8.2.3 | 117 | 11/5/2026 | |
| 8.2.2 | 113 | 11/3/2026 | |
| 8.2.1 | 123 | 10/28/2026 | |
| 8.2.0 | 128 | 10/20/2026 |
Loading failed