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
<PackageReference Include="Net4x.DapperLibrary.Extensions.Base" Version="1.9.9.6" />
<PackageVersion Include="Net4x.DapperLibrary.Extensions.Base" Version="1.9.9.6" />
<PackageReference Include="Net4x.DapperLibrary.Extensions.Base" />
paket add Net4x.DapperLibrary.Extensions.Base --version 1.9.9.6
#r "nuget: Net4x.DapperLibrary.Extensions.Base, 1.9.9.6"
#:package Net4x.DapperLibrary.Extensions.Base@1.9.9.6
#addin nuget:?package=Net4x.DapperLibrary.Extensions.Base&version=1.9.9.6
#tool nuget:?package=Net4x.DapperLibrary.Extensions.Base&version=1.9.9.6
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
DataTableviaIEnumerable<T>.ToDataTable()(ToDataTableExtension). - Convert
DataTable/DataRowto JSON withToJson()(usesSystem.Text.Jsonon .NET Standard andNewtonsoft.Jsonon older frameworks). - Convert
IDataReaderorDataTableto enumerable dictionaries withToDictionaries()andToDictionary()helpers. - Chunking helpers for splitting large
DataTableinstances 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
IDapperContextextension methods. - Utility methods such as
RecycleParameters()for cloningDbParameterinstances andFindMatchingRow()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.Jsonfor .NET Standard;Newtonsoft.Jsonfor legacy frameworks). - Extension methods are placed in the
System.Datanamespace to allow natural calling code onDataTable,DataRow,IDataReaderandIDapperContext. - The package includes this
README.mdwhen packed for NuGet.
For API details, consult the source files in Extensions and the DapperLibrary core documentation.
| Product | Versions 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. |
-
.NETFramework 3.5
- Net4x.DapperLibrary.Base (>= 1.9.9.6)
-
.NETFramework 4.0
- Net4x.DapperLibrary.Base (>= 1.9.9.6)
-
.NETFramework 4.5
- Net4x.DapperLibrary.Base (>= 1.9.9.6)
-
.NETFramework 4.6.1
- Net4x.DapperLibrary.Base (>= 1.9.9.6)
-
.NETStandard 2.0
- Net4x.DapperLibrary.Base (>= 1.9.9.6)
-
.NETStandard 2.1
- Net4x.DapperLibrary.Base (>= 1.9.9.6)
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.