Zymergi.Data
11.3.0-alpha
dotnet add package Zymergi.Data --version 11.3.0-alpha
NuGet\Install-Package Zymergi.Data -Version 11.3.0-alpha
<PackageReference Include="Zymergi.Data" Version="11.3.0-alpha" />
<PackageVersion Include="Zymergi.Data" Version="11.3.0-alpha" />
<PackageReference Include="Zymergi.Data" />
paket add Zymergi.Data --version 11.3.0-alpha
#r "nuget: Zymergi.Data, 11.3.0-alpha"
#:package Zymergi.Data@11.3.0-alpha
#addin nuget:?package=Zymergi.Data&version=11.3.0-alpha&prerelease
#tool nuget:?package=Zymergi.Data&version=11.3.0-alpha&prerelease
Zymergi.Data
ADO.NET helpers for Zymergi SaaS apps. The package uses extension methods, not an ORM. It builds parameterized commands, runs queries, manages one transaction per unit of work, and maps IDataRecord rows in code.
Targets .NET 10. Depends on Zymergi.Core. The namespace is Zymergi.Data. The types moved here from Zymergi.Core with no namespace change. A consumer adds a PackageReference and keeps its using Zymergi.Data; lines.
Install
dotnet add package Zymergi.Data
Zymergi.Data.MariaDb, Zymergi.Social, Zymergi.Search.Sqlite, and Zymergi.AspNetCore reference this package, so they bring it in transitively.
Interfaces
| Type | Purpose |
|---|---|
IDbConnectable |
Contract for classes that own a DbConnection and an optional DbUnitOfWork |
IDbConnectionFactory |
Factory contract for creating IDbConnection instances by provider name |
IDbRegistry |
Database-backed IRegistry exposing table name and primary key metadata |
IDbRegistrableRepository<T> |
Database-backed IRegistrableRepository with IDbRegistry support |
ILogRepository |
Obsolete. Repository contract for persisting and querying log records. Namespace Zymergi.Logging. It extends IDbConnectable, so it ships with this package. Removal is planned for 12.0 |
Classes
| Type | Purpose |
|---|---|
AppSettingsDbConnectionFactory |
IDbConnectionFactory implementation reading from appsettings.json |
DbUnitOfWork |
Async all-or-nothing transaction wrapper over DbConnection (create via CreateAsync) |
OpenConnectionScopeAsync |
Opens a connection for a scope and closes it on dispose only if the scope opened it |
ParameterBag |
Collects named parameters for generated SQL |
DbPrimaryKeyAttribute |
Marks a property as the database primary key |
DbGeneratedAttribute |
Marks database-generated properties excluded from INSERT/UPDATE |
DbRequiredAttribute |
Marks properties that cannot be null |
StartTimeAttribute |
Marks property as beginning of a searchable timespan |
EndTimeAttribute |
Marks property as end of a searchable timespan |
DbGenerateMode |
Enum specifying column value generation (None, AutoIncrement) |
Extension methods
| Type | Purpose |
|---|---|
DbCommandExtensionMethods |
Parameterize, AddParameter, and ExecuteReaderAsync on DbCommand |
DbConnectionExtensionMethods |
Async extensions for DbConnection (TryOpenAsync, TryCloseAsync, BuildCommand, QueryAsync, ExecuteAsync, ScalarAsync) |
OpenConnectionScopeExtensions |
OpenScopeAsync on DbConnection |
IDbCommandExtensionMethods |
GetParametersAsString for command diagnostics |
SelectSqlExtensionMethods |
Builds SELECT statements from KeyValuePair collections |
InsertSqlExtensionMethods |
Builds INSERT statements from KeyValuePair collections |
UpdateSqlExtensionMethods |
Builds UPDATE statements from KeyValuePair collections |
DbExpressionExtensionMethods |
Data record column definitions and element extraction |
DbExceptionExtensionMethods |
Elaborates exceptions with DbCommand diagnostic data |
MappingExtensionMethods |
Maps IDataRecord rows to objects and manipulates properties via reflection |
DataRecordExtensionMethods (Get<T>, GetNullable<T>) stays in Zymergi.Core.Utilities, because Core models map rows with it.
Usage
using Zymergi.Data;
await using var uow = await DbUnitOfWork.CreateAsync(connection, ct);
await connection.ExecuteAsync("UPDATE t SET name = @name WHERE uid = @uid",
[new("@name", name), new("@uid", uid)], uow.Transaction, ct);
await uow.CommitAsync(ct);
Bind ConnectionStringSettings and DbProviderFactorySettings (in Zymergi.Core.Config) from configuration. AppSettingsDbConnectionFactory resolves them. A production host registers its own ADO.NET provider.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Zymergi.Core (>= 11.3.0-alpha)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Zymergi.Data:
| Package | Downloads |
|---|---|
|
Zymergi.Data.MariaDb
MariaDB repository implementations for Zymergi entities. |
|
|
Zymergi.AspNetCore
ASP.NET Core controllers, authentication filters, and startup extensions for Zymergi. |
|
|
Zymergi.Social
The Social domain (users, groups, favorites, submissions, comments) as models and repository interfaces over Zymergi.Core. |
|
|
Zymergi.Search.Sqlite
SQLite implementation of the engine-neutral faceted-search contracts for Zymergi. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.3.0-alpha | 58 | 11/12/2026 |