MooDb 0.9.2

dotnet add package MooDb --version 0.9.2
                    
NuGet\Install-Package MooDb -Version 0.9.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MooDb" Version="0.9.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MooDb" Version="0.9.2" />
                    
Directory.Packages.props
<PackageReference Include="MooDb" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MooDb --version 0.9.2
                    
#r "nuget: MooDb, 0.9.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MooDb@0.9.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MooDb&version=0.9.2
                    
Install as a Cake Addin
#tool nuget:?package=MooDb&version=0.9.2
                    
Install as a Cake Tool

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 Sql surface
  • 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

  • MooDbContext is the main entry point
  • MooDbContext.Sql is the raw SQL escape hatch
  • MooTransaction is the transactional entry point
  • MooParams builds SQL Server parameters fluently
  • IMooMultiReader handles multiple results from one execution
  • MooBulk handles SQL Server bulk loading
  • MooDbContextOptions controls timeout and strict auto-mapping
  • AddMooDbContextFactory() registers factory support for dependency injection

Documentation

Full documentation is available at:

https://moodb.net

Recommended starting points:

  • Start Here
  • Philosophy
  • Creating a MooDb Instance
  • Your First Stored Procedure Call
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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