Synergit.Common
3.0.0
dotnet add package Synergit.Common --version 3.0.0
NuGet\Install-Package Synergit.Common -Version 3.0.0
<PackageReference Include="Synergit.Common" Version="3.0.0" />
<PackageVersion Include="Synergit.Common" Version="3.0.0" />
<PackageReference Include="Synergit.Common" />
paket add Synergit.Common --version 3.0.0
#r "nuget: Synergit.Common, 3.0.0"
#:package Synergit.Common@3.0.0
#addin nuget:?package=Synergit.Common&version=3.0.0
#tool nuget:?package=Synergit.Common&version=3.0.0
Synergit.Common
Common library of Synergit s.r.o.: a thin database client and general helpers.
Targets: .NET 10, .NET Framework 4.8.
Data access (Synergit.Data)
Db is a thin wrapper over ADO.NET: no ORM, no reflection mapping. Rows are read into DbRow and mapped explicitly,
typically in a DTO constructor. Use a provider package, e.g. Synergit.Data.MsSql (MsSqlDb).
using var db = new MsSqlDb(server, database, user, password);
// .NET 10: interpolated values are sent as parameters
var row = db.QueryRow($"SELECT * FROM dbo.Users WHERE ID = {id} AND Code = {code:varchar(20)}");
var users = db.QueryRows($"SELECT * FROM dbo.Users WHERE ID IN ({ids})", r => new UserItem(r));
// all targets: explicit parameters
var name = db.GetValue("SELECT Name FROM dbo.Users WHERE ID = @id", [db.CreateParameter("@id", id)]);
Execute,QueryValue,QueryRow,QueryRows,QueryValueToStream(+Async):SqlQueryinterpolated string, .NET 10 only.ExecSQL,GetValue,GetRow,GetRows,CopyValueToStream(+Async): SQL text with optionalDbParameterlist.DbRow: lenientAsString,AsInteger,AsNInteger,AsDecimal,AsDateTime,AsChar,AsEnum… (NULL → default), strictGetStrict<T>(throws on NULL or lossy conversion).CreateParameter(name, value, DbType, size, precision, scale)for varchar and decimal columns, see XML docs why.Format*methods create SQL literals for dynamically built SQL, prefer parameters.
Helpers (Synergit)
Utils (password hashing, encryption, command line), Extensions (string, byte[] and type extensions),
Config, DisposableObject.
Breaking changes in 3.0
GetValueFromDB/GetRowFromDB/GetRowsFromDBrenamed toGetValue/GetRow/GetRows.- Errors raised by statements after the first result set are thrown (were silently ignored).
Format*andDbRowconversions use the invariant culture.- Invalid arguments throw
ArgumentExceptioninstead ofException.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- No dependencies.
-
net10.0-windows7.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Synergit.Common:
| Package | Downloads |
|---|---|
|
Synergit.Data.MsSql
Library of MS SQL DB Thin Client for Synergit s.r.o. company |
GitHub repositories
This package is not used by any popular GitHub repositories.