Transformations.Data 2.0.0

dotnet add package Transformations.Data --version 2.0.0
                    
NuGet\Install-Package Transformations.Data -Version 2.0.0
                    
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.Data" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Transformations.Data" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Transformations.Data" />
                    
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.Data --version 2.0.0
                    
#r "nuget: Transformations.Data, 2.0.0"
                    
#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.Data@2.0.0
                    
#: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.Data&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Transformations.Data&version=2.0.0
                    
Install as a Cake Tool

Transformations.Data

A practical, problem-first .NET library for raw DataRow, DataReader, and SQL manipulation.

NuGet

📖 Overview

Despite the rise of ORMs, enterprise architectures often drop down to raw ADO.NET for high-performance ETL syncs, reporting, and bulk pipelines. Transformations.Data wraps the harsh edges of IDataReader and DataTable with elegant, fallback-driven conversion extensions.

🚀 Why Transformations.Data?

Retrieving DBNull.Value triggers runtime crashes if not constantly checked. These extensions introduce defensive getters, parameter upserting strategies, and collection-to-table mappers, dramatically cleaning up your data access layer.

💡 Key Features & Examples

1. Resilient DataRow Fetching

Avoid index out of range and boxing cast errors with a unified generic getter that accepts explicit type conversions and fallbacks.

foreach (DataRow row in dataTable.Rows)
{
    // Safely reads the value. If DBNull, missing, or mismatched, returns the fallback.
    int age = row.GetValue<int>("Age", fallback: 0);
    string name = row.GetValue<string>("FullName", fallback: "Unknown");
}

2. IDataReader Streamlining

Map streaming rows intuitively.

using (var reader = await command.ExecuteReaderAsync())
{
    while (await reader.ReadAsync())
    {
        // Null safe extraction
        Guid tenantId = reader.GetValue<Guid>("TenantId");
    }
}

3. Sql Parameter Upserting

When dynamically building SQL command instances, ensure parameters are seamlessly updated or appended without duplicate key exceptions.

command.UpsertParameter(new SqlParameter("@LastLogin", DateTime.UtcNow));

🛠 Advanced Usage

You can convert massive IEnumerable<T> lists directly into generic DataTable instances structurally formatted for SQL Server's Table-Valued Parameters (TVPs) for bulk insertion.

📦 Dependencies

  • Transformations.Core
  • Microsoft.Data.SqlClient

Part of the Transformations ecosystem. Designed for modern .NET 8+.

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

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
2.0.0 115 4/10/2026