MooDb 0.9.2
dotnet add package MooDb --version 0.9.2
NuGet\Install-Package MooDb -Version 0.9.2
<PackageReference Include="MooDb" Version="0.9.2" />
<PackageVersion Include="MooDb" Version="0.9.2" />
<PackageReference Include="MooDb" />
paket add MooDb --version 0.9.2
#r "nuget: MooDb, 0.9.2"
#:package MooDb@0.9.2
#addin nuget:?package=MooDb&version=0.9.2
#tool nuget:?package=MooDb&version=0.9.2
MooDb™
MooDb is a small, explicit micro ORM for SQL Server.
It is designed for developers who want a clean API over ADO.NET without taking on the weight of a large ORM. MooDb is stored procedure first, supports raw SQL when needed, and keeps common database work predictable.
MooDb is released under the MIT License and is free to use in both personal and commercial projects.
Why MooDb
MooDb is built around a few simple ideas:
- Stored procedure first by default
- Raw SQL is available through an explicit
Sqlsurface - Small public API that is easy to learn and hard to misuse
- Predictable mapping for classes, constructor-based models, and simple types
- Strict auto-mapping when you want result shapes checked more closely
- Custom mapping when you want full control
- Multiple results without making the caller manage live readers
- Transactions with the same general shape as the main entry point
- Bulk loading for fast back-office and batch data movement
- No forced abstraction layer for ordinary usage
MooDb stays close to ADO.NET while removing repetitive plumbing.
Installation
<PackageReference Include="MooDb" Version="x.y.z" />
MooDb targets SQL Server and is built on Microsoft.Data.SqlClient.
Quick start
using MooDb;
var db = new MooDbContext(connectionString);
var user = await db.SingleAsync<User>(
"dbo.usp_User_GetById",
new MooParams()
.AddInt("@UserId", 42));
MooDb is designed to keep database access explicit and predictable.
For raw SQL, use the explicit Sql surface:
var user = await db.Sql.SingleAsync<User>(
"select UserId, DisplayName from dbo.tbl_User where UserId = @UserId",
new MooParams()
.AddInt("@UserId", 42));
Main concepts
MooDbContextis the main entry pointMooDbContext.Sqlis the raw SQL escape hatchMooTransactionis the transactional entry pointMooParamsbuilds SQL Server parameters fluentlyIMooMultiReaderhandles multiple results from one executionMooBulkhandles SQL Server bulk loadingMooDbContextOptionscontrols timeout and strict auto-mappingAddMooDbContextFactory()registers factory support for dependency injection
Documentation
Full documentation is available at:
Recommended starting points:
- Start Here
- Philosophy
- Creating a MooDb Instance
- Your First Stored Procedure Call
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.Data.SqlClient (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
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 |
|---|---|---|
| 0.9.2 | 30 | 4/9/2026 |