Net4x.DapperLibrary.Extensions.Base 1.9.9.6

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

DapperLibrary.Extensions.Base

Extensions focused on common DataTable, DataRow, IDataReader and IDapperContext operations used across the DapperLibraries.

This project provides small, well-scoped helpers that simplify data manipulation and database table operations when working with IDapperContext and ADO.NET DataTable/DataReader objects.

Key features

  • Convert collections to DataTable via IEnumerable<T>.ToDataTable() (ToDataTableExtension).
  • Convert DataTable/DataRow to JSON with ToJson() (uses System.Text.Json on .NET Standard and Newtonsoft.Json on older frameworks).
  • Convert IDataReader or DataTable to enumerable dictionaries with ToDictionaries() and ToDictionary() helpers.
  • Chunking helpers for splitting large DataTable instances into smaller batches (ToChunks).
  • Helpers to read rows by primary key, save data in chunks and create or prepare tables on the target database via IDapperContext extension methods.
  • Utility methods such as RecycleParameters() for cloning DbParameter instances and FindMatchingRow() to locate matching rows by column name.

Supported targets

This project is multi-targeted to support a variety of .NET Framework and .NET Standard runtimes used in the DapperLibraries solution. Conditional compilation is used to remain compatible with older framework versions.

Usage examples

Convert an IEnumerable<T> to a DataTable:

var table = myCollection.ToDataTable("MyTable");

Serialize a DataTable to JSON:

string json = dataTable.ToJson();

Read an IDataReader into dictionaries:

foreach (var row in reader.ToDictionaries())
{
    // row is a Map<string, object?> (dictionary-like)
}

Split a large table into chunks:

var chunks = dataTable.ToChunks(batchSize: 5000);

Use IDapperContext extension to ensure a table exists before saving:

// inside a context-aware flow
await dapperContext.CreateTableIfNotExists[connectionName](table, primaryKeySize);
await dapperContext.SaveDataTableInChunksAsync[connectionName](table, batchSize);

Dependencies

This project depends on the DapperLibrary core project and types such as IDapperContext, DapperContext, DapperContextFactory, and various database model helpers available in the solution.

Notes

  • JSON serialization behavior differs by target framework (System.Text.Json for .NET Standard; Newtonsoft.Json for legacy frameworks).
  • Extension methods are placed in the System.Data namespace to allow natural calling code on DataTable, DataRow, IDataReader and IDapperContext.
  • The package includes this README.md when packed for NuGet.

For API details, consult the source files in Extensions and the DapperLibrary core documentation.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net35 is compatible.  net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Net4x.DapperLibrary.Extensions.Base:

Package Downloads
Net4x.DapperLibrary.MergeUtility

Package Description

Net4x.SpreadsheetLibrary.Utility

Package Description

Net4x.DapperLibrary.Extensions.Archive

Package Description

Net4x.HtmlPersist

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.9.9.6 163 1/6/2026
1.9.9.5 157 1/6/2026
1.9.9.4 164 1/6/2026
1.9.9.3 218 1/5/2026
1.9.9.2 225 12/30/2025
1.9.9.1 234 12/30/2025
1.9.9 317 12/22/2025
1.6.0.12 237 12/12/2025
1.6.0.11 229 12/12/2025