Transformations.EntityFramework 2.0.4.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Transformations.EntityFramework --version 2.0.4.1
                    
NuGet\Install-Package Transformations.EntityFramework -Version 2.0.4.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="Transformations.EntityFramework" Version="2.0.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Transformations.EntityFramework" Version="2.0.4.1" />
                    
Directory.Packages.props
<PackageReference Include="Transformations.EntityFramework" />
                    
Project file
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 Transformations.EntityFramework --version 2.0.4.1
                    
#r "nuget: Transformations.EntityFramework, 2.0.4.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 Transformations.EntityFramework@2.0.4.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=Transformations.EntityFramework&version=2.0.4.1
                    
Install as a Cake Addin
#tool nuget:?package=Transformations.EntityFramework&version=2.0.4.1
                    
Install as a Cake Tool

Transformations.EntityFramework

Resilient SaveChanges, structured audit extraction, and IQueryable CSV export for EF Core — without subclassing DbContext or adding custom interceptors.

NuGet .NET 8 | 9 | 10

📖 Overview

Transformations.EntityFramework equips any standard DbContext with resilient saves, structured audit extraction, and IQueryable CSV export — without subclassing DbContext or writing custom interceptors.

🚀 Why Transformations.EntityFramework?

EF Core is powerful, but two things require disproportionate effort: handling transient connectivity drops (Azure SQL throttling, network blips) and capturing exactly which properties changed before a save. The standard workarounds — custom execution strategies, SaveChanges overrides, manual ChangeTracker loops — mean boilerplate in every project. These extensions inject both capabilities as simple extension method calls on any existing DbContext.

📦 Install

<PackageReference Include="Transformations.EntityFramework" Version="2.0.4.1" />

💡 What's Included

Resilient SaveChanges

Wraps SaveChangesAsync with exponential backoff and optional exception filters. Handles transient connectivity drops on Azure SQL and other cloud databases.

// 4 retries, 250ms initial delay (doubles each attempt)
int rowsAffected = await context.SaveChangesWithRetryAsync(
    retryCount: 4,
    initialDelay: TimeSpan.FromMilliseconds(250));

// With cancellation token
await context.SaveChangesWithRetryAsync(cancellationToken: ct);

ChangeTracker Audit Extraction

Captures structured AuditEntry records from EF Core's ChangeTracker before calling SaveChanges. After save, entity states are reset — so capture first.

// Capture all pending Added/Modified/Deleted changes
var audit = context.GetAuditEntries();

// Or filter to a specific state
var modified = context.GetAuditEntries(EntityState.Modified);

await context.SaveChangesWithRetryAsync();

foreach (var entry in modified)
{
    logger.LogInformation("{Entity} [{Key}] — {Prop}: {Old} → {New}",
        entry.EntityType,
        entry.KeyValues,
        entry.PropertyName,
        entry.OriginalValue,
        entry.CurrentValue);
}

AuditEntry properties: EntityType, State, PropertyName, OriginalValue, CurrentValue, KeyValues, TimestampUtc.

IQueryable → CSV Export

Materializes a query and joins results with a configurable separator. Each element is rendered via ToString().

// Comma-separated (default)
string csv = await context.Users
    .Where(u => u.IsActive)
    .Select(u => u.Email)
    .ToCsvAsync();

// Custom separator
string tsv = await context.Users
    .Select(u => u.Name)
    .ToCsvAsync(separator: '\t');

🛠 API Reference

Class Purpose Key Members
DbContextResilienceExtensions Resilient saves SaveChangesWithRetryAsync(retryCount, initialDelay, shouldRetry, ct)
ChangeTrackerAuditExtensions Audit capture GetAuditEntries(), GetAuditEntries(EntityState)
QueryableCsvExtensions CSV export ToCsvAsync<T>(ct), ToCsvAsync<T>(separator, ct)
AuditEntry Audit record EntityType, State, PropertyName, OriginalValue, CurrentValue, KeyValues, TimestampUtc

📦 Dependencies

  • Transformations.Core
  • Microsoft.EntityFrameworkCore

License

MIT — Copyright © 2026 opentail.net

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Transformations.EntityFramework:

Package Downloads
Transformations

Modern .NET transformation helpers for conversion, strings, collections, data, web, diagnostics, batching, and resilience.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.4.2 91 7/7/2026
2.0.4.1 115 7/7/2026
2.0.0 121 4/10/2026