SetNet.Persistence.Dapper
1.2.0
dotnet add package SetNet.Persistence.Dapper --version 1.2.0
NuGet\Install-Package SetNet.Persistence.Dapper -Version 1.2.0
<PackageReference Include="SetNet.Persistence.Dapper" Version="1.2.0" />
<PackageVersion Include="SetNet.Persistence.Dapper" Version="1.2.0" />
<PackageReference Include="SetNet.Persistence.Dapper" />
paket add SetNet.Persistence.Dapper --version 1.2.0
#r "nuget: SetNet.Persistence.Dapper, 1.2.0"
#:package SetNet.Persistence.Dapper@1.2.0
#addin nuget:?package=SetNet.Persistence.Dapper&version=1.2.0
#tool nuget:?package=SetNet.Persistence.Dapper&version=1.2.0
SetNet.Persistence.Dapper
Dapper-backed IDocumentStore<T> / ISnapshotStore for SetNet.Persistence — store any POCO as JSON in a key/value table on any ADO.NET database (SQLite, PostgreSQL, MySQL, SQL Server…).
Custom fields need no schema change — the whole object is serialized, so a CharacterData with a per-character VipUntil just works. Upsert is portable (delete + insert in a transaction), so no dialect-specific ON CONFLICT/MERGE.
using SetNet.Persistence.Dapper;
using Microsoft.Data.Sqlite;
public sealed class CharacterData
{
public string Name { get; set; } = "";
public int Level { get; set; }
public DateTime? VipUntil { get; set; } // custom field — no migration
public Dictionary<string, object> Extra { get; set; } = new();
}
var store = new DapperDocumentStore<CharacterData>(
() => new SqliteConnection("Data Source=game.db")); // any ADO.NET connection factory
await store.SetAsync("char:1", new CharacterData { Name = "Archer", Level = 80, VipUntil = DateTime.UtcNow.AddDays(30) });
var c = await store.GetAsync("char:1");
new DapperDocumentStore<T>(connectionFactory, table = "setnet_documents", json?, ensureTableSql?) — pass ensureTableSql for engines without CREATE TABLE IF NOT EXISTS (e.g. SQL Server). DapperSnapshotStore stores opaque blobs the same way. Table names are interpolated into SQL, so keep them trusted constants; keys/values are always parameterized.
Depends on SetNet.Persistence + Dapper. Targets net8.0.
License
MIT
| Product | Versions 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 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. |
-
net8.0
- Dapper (>= 2.1.35)
- SetNet.Persistence (>= 1.2.0)
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 |
|---|---|---|
| 1.2.0 | 144 | 8/5/2026 |