Transformations.EntityFramework
2.0.4.2
dotnet add package Transformations.EntityFramework --version 2.0.4.2
NuGet\Install-Package Transformations.EntityFramework -Version 2.0.4.2
<PackageReference Include="Transformations.EntityFramework" Version="2.0.4.2" />
<PackageVersion Include="Transformations.EntityFramework" Version="2.0.4.2" />
<PackageReference Include="Transformations.EntityFramework" />
paket add Transformations.EntityFramework --version 2.0.4.2
#r "nuget: Transformations.EntityFramework, 2.0.4.2"
#:package Transformations.EntityFramework@2.0.4.2
#addin nuget:?package=Transformations.EntityFramework&version=2.0.4.2
#tool nuget:?package=Transformations.EntityFramework&version=2.0.4.2
Transformations.EntityFramework
Resilient SaveChanges, structured audit extraction, and IQueryable CSV export for EF Core — without subclassing DbContext or adding custom interceptors.
📖 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.2" />
💡 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.CoreMicrosoft.EntityFrameworkCore
License
MIT — Copyright © 2026 opentail.net
| Product | Versions 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. |
-
net10.0
- Microsoft.EntityFrameworkCore (>= 9.0.7)
- Transformations.Core (>= 2.0.4.2)
-
net8.0
- Microsoft.EntityFrameworkCore (>= 9.0.7)
- Transformations.Core (>= 2.0.4.2)
-
net9.0
- Microsoft.EntityFrameworkCore (>= 9.0.7)
- Transformations.Core (>= 2.0.4.2)
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.