Transformations.Core
2.0.0
dotnet add package Transformations.Core --version 2.0.0
NuGet\Install-Package Transformations.Core -Version 2.0.0
<PackageReference Include="Transformations.Core" Version="2.0.0" />
<PackageVersion Include="Transformations.Core" Version="2.0.0" />
<PackageReference Include="Transformations.Core" />
paket add Transformations.Core --version 2.0.0
#r "nuget: Transformations.Core, 2.0.0"
#:package Transformations.Core@2.0.0
#addin nuget:?package=Transformations.Core&version=2.0.0
#tool nuget:?package=Transformations.Core&version=2.0.0
Transformations.Core
A practical, problem-first .NET library for everyday string, collection, conversion, and diagnostic tasks.
📖 Overview
Transformations.Core is the dependency-minimal foundation of the Transformations ecosystem. Rather than scattering repetitive generic helper methods across your codebase, this library aggregates hardened, production-ready tools for common infrastructural tasks. It covers resilient execution primitives, deep reflection-based object deltas, array batching, and semantic string parsing.
🚀 Why Transformations.Core?
When developing modern .NET microservices, you often need robust retries, reliable type conversion (with fallbacks), and fast collection handling. Transformations.Core is built strictly for .NET 8/9/10, aggressively utilizing Span<T> and modern BCL enhancements to ensure a virtually zero-allocation profile for hot-path operations.
💡 Key Features & Examples
1. Resilient Execution (With Jittered Backoff)
Network calls and I/O operations inherently fail. The Resilience class gives you dead-simple, highly configurable retry logic with built-in exponential backoff and jitter to prevent thundering herds.
// Execute a network call, retrying up to 5 times if transient exceptions occur.
// Initial delay starts at 200ms and grows exponentially, with a 25% random jitter factor.
var result = await Resilience.RetryAsync(
async () => await FetchExternalDataAsync(),
retryCount: 5,
initialDelay: TimeSpan.FromMilliseconds(200),
jitterFactor: 0.25
);
2. Deep Object Deltas
When dealing with audit trails or patching frameworks, determining exactly what changed between two graphs is painful. ObjectDelta.Compare handles this out of the box without infinite reflection loops.
var original = new User { Id = 1, Role = "Admin", Settings = new { Theme = "Dark" } };
var updated = new User { Id = 1, Role = "User", Settings = new { Theme = "Light" } };
var delta = ObjectDelta.Compare(original, updated);
// delta exposes precise pathways:
// delta.Changes contains:
// - "Role" (Admin -> User)
// - "Settings.Theme" (Dark -> Light)
3. Safe Conversions & String Manipulations
Drop TryParse cascades. Use fluent conversions, safe default fallbacks, and semantic comparers.
// 1. Safe parsing
string input = "not-a-number";
int age = input.ConvertTo<int>(fallback: 18);
// 2. HTML Sanitization
string dirtyHtml = "<script>alert(1);</script><p>Hello <b>World</b></p>";
string cleanHtml = dirtyHtml.SanitizeHtml(HtmlSanitizationPolicy.PermitInlineFormatting);
// Outputs: "<p>Hello <b>World</b></p>"
🛠 Advanced Usage
- Diagnostics: Capture metrics and host CPU/VRAM process snapshots rapidly via
DiagnosticsProbe. - Batching:
BatchTransformationsuses highly optimizedSpan<T>APIs to mutate arrays completely in place without creating intermediate lists.
📦 Dependencies
- .NET 8.0, 9.0, 10.0
- (Zero external NuGet dependencies)
Part of the Transformations ecosystem. Designed for modern .NET 8+.
| 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
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Transformations.Core:
| Package | Downloads |
|---|---|
|
Transformations.Dapper
Dapper resilience extensions — async retry with transient SQL fault detection, powered by Transformations.Core. |
|
|
Transformations.Data
Data-focused transformation helpers for DataRow, DataReader, SQL, and table/list conversion. |
|
|
Transformations.Web
Web-focused transformation helpers for HTTP, session, cookies, query string, and configuration. |
|
|
Transformations.EntityFramework
EF Core resilience extensions - async SaveChanges retry, ChangeTracker audit logging, and IQueryable CSV export, powered by Transformations.Core. |
|
|
Transformations.Mapping
Zero-reflection object mapper powered by source generation and Transformations.Core type conversion. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 200 | 4/9/2026 |