Zonkey.Data 7.0.1

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

Zonkey.Data

The core Zonkey ORM library. Provides object-relational mapping, querying, persistence, and multi-database support for .NET applications.

Installation

dotnet add package Zonkey.Data

What's Inside

  • DataClassAdapter<T> -- typed CRUD operations for mapped classes
  • DataClass -- optional base class with per-object change tracking
  • DataItemAttribute / DataFieldAttribute -- attribute-based table and column mapping
  • DatabaseWrapper -- abstract base class for connection lifecycle management
  • DataManager -- raw SQL execution (scalar, non-query, reader, DataSet)
  • SqlFilter -- fluent, parameterized WHERE clause building
  • DataTableAdapter -- CRUD operations for DataTable/DataSet
  • Dialect system -- automatic SQL generation for SQL Server, PostgreSQL, MySQL, SQLite, Oracle, DB2, and more

Target Frameworks

  • .NET 8
  • .NET 10
  • .NET Framework 4.8

Key Concepts

Every database operation is explicit. You control when queries execute, what gets saved, and how connections are managed. There is no ambient context, no lazy loading, and no implicit persistence.

Change tracking is per-object through DataRowState (Added, Modified, Unchanged, Detached) and is only active when your classes inherit from DataClass.

Quick Example

var adapter = new DataClassAdapter<Product>(connection);

// Query
var product = await adapter.GetOne(p => p.Id == 42);

// Modify
product.Price = 19.99m;

// Save -- only the price column is updated
await adapter.Save(product);

Documentation

See the full documentation for detailed guides on all features.

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 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 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. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Zonkey.Data:

Package Downloads
Zonkey.Data.MsSql

MS-SQL Extensions for Zonkey.Data

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
7.0.3 103 8/13/2026
7.0.1 389 8/6/2026
7.0.0 140 7/30/2026
6.5.0.5000-rc3 568 3/28/2025
6.5.0.5000-rc2 236 3/26/2025
6.5.0.5000-rc1 262 3/26/2025 6.5.0.5000-rc1 is deprecated.
6.2.1.2000 22,564 2/10/2025
6.2.0.1900 28,979 7/28/2023
6.1.0.1700 22,580 12/30/2022
6.0.0.1600 5,048 8/14/2022
6.0.0.1600-pre 306 8/14/2022
5.2.1 182,927 12/22/2020
5.1.6 27,429 7/29/2018

Zonkey 7.0.1 adds symmetric DateOnly/TimeOnly conversions: providers that surface date/time columns as DateOnly/TimeOnly (notably Npgsql 10) now fill DateTime, TimeSpan, and string properties correctly on both materialization paths, DateOnly/TimeOnly property values round-trip to all supported databases, date/time-ish values destined for string properties render as round-trip ISO strings instead of culture-specific text, and TimeSpan properties now fill from string (standard "d.hh:mm:ss" TimeSpan.Parse forms, e.g. text-backed SQLite time columns) and DateTime (time-of-day) sources.

7.0.1 also reworks IN-list translation: a single value now renders as "col = @p0" rather than "col IN (@p0)"; PostgreSQL binds a list of two or more as one array parameter ("col = ANY($0)") at any size, removing the parameter-count ceiling there; a null in the list never matches, following SQL IN semantics rather than C# Contains semantics; and an empty or all-null list renders a commented "1 = 0". SplitList() is obsolete on .NET 6 and later in favour of System.Linq's Chunk(), and remains supported on .NET Framework 4.8, which has no Chunk. See the "Translation policy" section of docs/querying.md.

Zonkey 7.0 is a major release with breaking changes. Packages now target .NET 8, .NET 10, and .NET Framework 4.8 (Zonkey.Text targets .NET Standard 2.0 and .NET Framework 4.8), and assemblies are no longer strong-name signed. Applications on .NET 7 or earlier (including .NET 5/6 and .NET Core), on .NET Framework before 4.8, or requiring strong-named assemblies should stay on the latest v6.x release. See https://github.com/kellybirr/zonkey for full documentation, and see the repository README's "Breaking Changes from v6.x" section for the complete list of API changes (such as WithTransaction) and WHERE-expression behavior changes. FillRange paging on SQL Server now uses OFFSET/FETCH and requires SQL Server 2012 or later.