TinyORM 2.0.2
dotnet add package TinyORM --version 2.0.2
NuGet\Install-Package TinyORM -Version 2.0.2
<PackageReference Include="TinyORM" Version="2.0.2" />
<PackageVersion Include="TinyORM" Version="2.0.2" />
<PackageReference Include="TinyORM" />
paket add TinyORM --version 2.0.2
#r "nuget: TinyORM, 2.0.2"
#:package TinyORM@2.0.2
#addin nuget:?package=TinyORM&version=2.0.2
#tool nuget:?package=TinyORM&version=2.0.2
Simple, fast, and secure micro ORM for .NET 
TinyORM by Stan Drapkin [sdrapkin at sdprime dot com]
Documentation: wiki
Features:
- Focused on SQL Server (any SqlClient-based db engine). Azure SQL is supported as well.
- Intuitive, tiny, simple API. This is usually the hardest part for libraries to get right.
- Does not obscure or reinvent T-SQL. If you prefer APIs that hideT-SQLincompetence, look elsewhere.
- Very fast. As fast as competition (Dapper,OrmLite,LLBLGen,EF Core, etc. benchmarks).
- Seamlessly transactional and safe. Transactions are not merely supported - they are the default.
- XACT_ABORT=ON(automatic transaction rollback on runtime T-SQL errors).
- Custom transaction scopes are declared via standard TransactionScopeinstance (created viaTinyORM.DbContext.CreateTransactionScope()factory).
 
- Transparent connection management. One less thing to worry about and screw up. Never think about connections again.
- Task-based- asyncAPI (ie. the API). All calls are buffered (focus on safety and fast connection release).
- POCOs or anonymousobjects are fine. No inheritance, interface, or attribute requirements.
- Returns dynamicentities which can be consumed directly, or projected to statically-typed objects (fast!).- Either strict (perfect-match) or relaxed (best-effort) projection of dynamicto statically-typed objects.
 
- Either strict (perfect-match) or relaxed (best-effort) projection of 
- Full parameterization, with parameter list expansion (ex. WHERE Id IN (@IdList)). This also helps prevent SQL injection.- CHAR,- VARCHAR,- NCHAR,- NVARCHARsupport for- stringparameters.
 
- Single or multiple Result Sets.
- Snapshots provide change-tracking, with UPDATET-SQLgeneration for partial updates.
- Intelligent batched *bulk* command sequences via QueryBatch(not just forINSERT- for allCREATE/UPDATE/DELETE/MERGEcommands).
- Streaming data-out support (ex. streaming out BLOBs/files).
- Auditing
- Caller identity tracking (which user made the call?).
- Callsite tracking (which source code filename, method, and line# made the call?).
 
- Helpers for CREATE,UPDATE,DELETE, andUPSERTT-SQLgeneration.
- SequentialGuidgenerator for fragmentation-free, unique, unguessable, code-generated clustered- uniqueidentifierindexes.
- c# 10.0 in safemode. Compiledany cpufor .NET 4.5.2+ and NetStandard 2.0/.NET Core 2.0+.
- Tiny codebase. Tiny ~45k .dll.
- TinyORMon NuGet (- Install-Package TinyORM).
- MS-PL (Microsoft Public) license. If MS-PL does not suit you, contact me.
If you are serious about SQL Server, give TinyORM a try (even if you're a Dapper fan).
Simple TinyORM query
var db = DbContext.Create(connString);
var query = await db.QueryAsync("select [Answer] = @a + @b", new { @a = 123, @b = 2 });
Console.WriteLine(query.First().Answer); // prints "125"
static string connString = "Data Source=.\\SQL2012; Initial Catalog=tempdb; Integrated Security=True;";
| 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. | 
| .NET Framework | net48 is compatible. net481 was computed. | 
- 
                                                    .NETFramework 4.8- Microsoft.Data.SqlClient (>= 6.0.1)
- System.Reflection.Emit (>= 4.7.0)
- System.Reflection.Emit.Lightweight (>= 4.7.0)
- System.ValueTuple (>= 4.5.0)
 
- 
                                                    net8.0- Microsoft.Data.SqlClient (>= 6.0.1)
- System.Reflection.Emit (>= 4.7.0)
- System.Reflection.Emit.Lightweight (>= 4.7.0)
- System.ValueTuple (>= 4.5.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 | 
|---|---|---|
| 2.0.2 | 204 | 2/12/2025 | 
| 2.0.0 | 209 | 12/11/2024 | 
| 1.3.7 | 281 | 1/16/2024 | 
| 1.3.6 | 1,321 | 11/9/2022 | 
| 1.3.5 | 753 | 2/1/2022 | 
| 1.3.4 | 597 | 1/29/2022 | 
| 1.3.3 | 6,047 | 9/29/2020 | 
| 1.3.2 | 885 | 2/20/2020 | 
| 1.3.1 | 1,077 | 1/3/2020 | 
| 1.3.0 | 2,265 | 10/24/2019 | 
| 1.2.7067.20307 | 3,522 | 5/8/2019 | 
| 1.1.6898.20236 | 1,621 | 11/20/2018 | 
| 1.1.6862.24420 | 982 | 10/15/2018 | 
| 1.1.6848.28993 | 1,022 | 10/1/2018 | 
| 1.1.6701.26060 | 2,134 | 5/7/2018 | 
| 1.1.6528.30785 | 1,428 | 11/15/2017 | 
| 1.1.6326.31656 | 1,976 | 4/27/2017 | 
| 1.0.6314.33866 | 1,291 | 4/15/2017 | 
| 1.0.6310.25316 | 1,302 | 4/11/2017 | 
| 1.0.6309.30883 | 1,310 | 4/10/2017 | 
| 1.0.5 | 1,350 | 3/23/2017 | 
| 1.0.4 | 1,292 | 3/21/2017 | 
| 1.0.3 | 1,332 | 1/25/2017 | 
| 1.0.2 | 1,329 | 1/4/2017 | 
Switched to Microsoft.Data.SqlClient [https://techcommunity.microsoft.com/blog/sqlserver/announcement-system-data-sqlclient-package-is-now-deprecated/4227205].
Retargeted for [net8.0+] (modern use) and [net48] (legacy use).
Tested with Microsoft.Data.SqlClient 6.0.1 (https://learn.microsoft.com/en-us/sql/connect/ado-net/introduction-microsoft-data-sqlclient-namespace).
DbContext.Create() gets a new SqlConnectionOverrides parameter (https://learn.microsoft.com/en-us/dotnet/api/microsoft.data.sqlclient.sqlconnectionoverrides).
Added support for System.DateOnly and System.TimeOnly (.NET 8+).