Transformations.Data 2.0.4.2

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

Transformations.Data

Typed, null-safe extensions for ADO.NET DataRow, IDataReader, and SqlParameter — eliminating boilerplate DBNull checks and manual parameter wiring in data-access layers.

NuGet .NET 8 | 9 | 10

📖 Overview

Transformations.Data wraps the harsh edges of raw ADO.NET — DataRow, IDataReader, and SqlParameter — with typed, null-safe extension methods. It's the layer that makes high-performance ETL pipelines, reporting queries, and bulk operations clean to write.

🚀 Why Transformations.Data?

Despite the rise of ORMs, enterprise architectures regularly drop down to raw ADO.NET for bulk inserts, stored-procedure calls, and reporting pipelines. The problem is that DBNull.Value, boxing cast errors, and manual SqlParameter wiring pollute every data-access method. Transformations.Data introduces defensive typed getters and a fluent parameter API that eliminates this boilerplate entirely.

📦 Install

<PackageReference Include="Transformations.Data" Version="2.0.4.2" />

💡 What's Included

Safe DataRow Extraction

Eliminates DBNull.Value checks, boxing cast errors, and index-out-of-range exceptions. A unified generic getter accepts an explicit type and fallback.

foreach (DataRow row in dataTable.Rows)
{
    int    age  = row.GetValue<int>("Age", fallback: 0);
    string name = row.GetValue<string>("FullName", fallback: "Unknown");
    Guid   id   = row.GetValue<Guid>("TenantId");
}

// Check column/row presence before reading
if (row.HasColumns("LastLogin") && !row.IsNumericValue("Status"))
    Process(row);

IDataReader Extensions

Type-safe column extraction directly on streaming readers:

using var reader = await command.ExecuteReaderAsync();
while (await reader.ReadAsync())
{
    Guid   tenantId = reader.GetValue<Guid>("TenantId");
    string email    = reader.GetValue<string>("Email", fallback: string.Empty);
}

SqlParameter Construction

Fluent extension methods for building SqlParameter instances from any .NET type, with explicit SqlDbType control. Covers all primitives, nullable variants, DataTable (TVP), XDocument, and byte[].

// Value → SqlParameter
SqlParameter p1 = userId.ToSqlParameter("@UserId");
SqlParameter p2 = createdAt.ToSqlParameter("@CreatedAt", SqlDbType.DateTime2);
SqlParameter p3 = xmlDoc.ToSqlParameter("@Payload");

// Build a parameter list fluently
var cmd = new SqlCommand("EXEC sp_UpsertUser", conn);
cmd.Parameters.Add(userId,    "@UserId",    SqlDbType.Int);
cmd.Parameters.Add(email,     "@Email",     50, SqlDbType.VarChar);
cmd.Parameters.Add(tvpTable,  "@UserList",  typeName: "dbo.UserTableType");

// Chain setters on an existing parameter
existingParam
    .SetDirection(ParameterDirection.Output)
    .SetSqlDbType(SqlDbType.Int)
    .SetSize(4);

CSV Generation from Collections and DataTables

// From IEnumerable<T>
string csv = people.ToCsv();
string tsv = people.ToCsv(separator: '\t', qualifier: '"');

// From DataTable
string csv = dataTable.ToCsv();

🛠 API Reference

Class Purpose Key Members
DataRowConverter Safe DataRow access GetValue<T>, TryGetValue<T>, GetStringValue, HasRows, HasColumns, IsNumericValue
DataReaderHelper IDataReader typed access GetValue<T> with column name and optional fallback
SqlHelper SqlParameter builders ToSqlParameter (20+ type overloads), ToSqlParameterList, ToParameterArray, SetDirection, SetSqlDbType, SetValue, SetSize, ValidateParameters
CsvHelper CSV generation ToCsvIEnumerable<T> or DataTable, configurable separator and text qualifier

📦 Dependencies

  • Transformations.Core
  • Microsoft.Data.SqlClient

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

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.4.2 37 7/7/2026
2.0.4.1 44 7/7/2026
2.0.0 125 4/10/2026