Simple, fast, and secure micro ORM for .NET.
$ dotnet add package TinyORM
TinyORM by Stan Drapkin [sdrapkin at sdprime dot com]
SqlClient-based db engine). Azure SQL is supported as well.T-SQL. If you prefer APIs that hide T-SQL incompetence, look elsewhere.Dapper, OrmLite, LLBLGen, EF Core, etc. benchmarks).XACT_ABORT=ON (automatic transaction rollback on runtime T-SQL errors).TransactionScope instance (created via TinyORM.DbContext.CreateTransactionScope() factory).Task-based async API (ie. the API). All calls are buffered (focus on safety and fast connection release).anonymous objects are fine. No inheritance, interface, or attribute requirements.dynamic entities which can be consumed directly, or projected to statically-typed objects (fast!).
dynamic to statically-typed objects.WHERE Id IN (@IdList)). This also helps prevent SQL injection.
CHAR, VARCHAR, NCHAR, NVARCHAR support for string parameters.UPDATE T-SQL generation for partial updates.QueryBatch (not just for INSERT - for all CREATE/UPDATE/DELETE/MERGE commands).BLOBs/files).CREATE, UPDATE, DELETE, and UPSERT T-SQL generation.SequentialGuid generator for fragmentation-free, unique, unguessable, code-generated clustered uniqueidentifier indexes.safe mode. Compiled any cpu for .NET 4.5.2+ and NetStandard 2.0/.NET Core 2.0+..dll.TinyORM on NuGet (Install-Package TinyORM).If you are serious about SQL Server, give TinyORM a try (even if you're a Dapper fan).
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;";