项目
在 GitHub 查看 Simple, fast, and secure micro ORM for .NET
sdrapkin/SecurityDriven.TinyORM
sdrapkin/SecurityDriven.TinyORM has 308 GitHub stars and 17 forks. GitHot measured -1 stars in 24 hours and 0 in 7 days. Last checked 2026-11-20 06:45 UTC. Last push 2025-02-12.
可以做什么
- 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 hide T-SQL incompetence, look elsewhere.
- Very fast. As fast as competition (Dapper, OrmLite, LLBLGen, EF Core, etc. benchmarks).
实测星标增长
- 24小时
- -1
- 7天
- 0
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
关于
.NET micro ORM done right.
数据README.md
原文
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-basedasyncAPI (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 forstringparameters.
- 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 clustereduniqueidentifierindexes.- 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;";