Start Here
What this page covers#
This page explains what MooDb is, who it is for, where it fits, and where to begin.
What MooDb is#
MooDb is a small, explicit micro ORM for SQL Server.
It helps with common ADO.NET database work such as:
- executing stored procedures
- executing SQL text when needed
- reading scalar values
- reading one row or many rows
- mapping rows to .NET types
- reading multiple results from one execution
- running work inside a transaction
- bulk loading rows into a table
Where MooDb fits#
MooDb sits in the middle between raw ADO.NET and a larger ORM.
That means it tries to give you a cleaner and more predictable developer experience without hiding the database behind a large abstraction layer.
It is a good fit when you:
- use SQL Server
- want to stay close to SQL and ADO.NET
- like explicit behaviour
- want a smaller API than a larger ORM
- want stored procedures to be the main path
Why someone would use MooDb#
A lot of database code is repetitive even when the underlying work is simple.
You often end up repeating the same kinds of plumbing:
- opening connections
- creating commands
- adding parameters
- reading rows
- converting values
- disposing readers and commands correctly
MooDb exists to reduce that repetitive plumbing while still keeping the actual database operation visible.
What MooDb is not trying to be#
MooDb is not trying to be a large ORM that models your whole database or generates a lot of hidden behaviour for you.
It is intentionally smaller than that.
The goal is to make common SQL Server work easier and clearer, not to hide SQL Server from you.
How the docs are arranged#
- Getting Started is the most beginner-friendly part.
- Core Concepts explains how MooDb thinks.
- Guides show how to do specific tasks.
- Reference is the factual public API area.
- Recipes show practical ways to organise code.
Where to begin#
If you are new to MooDb, read these first:
- Philosophy
- Creating a MooDbContext
- Your First Stored Procedure Call
- Your First SQL Query
- Your First Transaction
The main ideas to keep in mind#
If you only remember a few things at the start, remember these:
MooDbContextis the stored procedure-first entry pointdb.Sqlis the raw SQL pathMooParamsis the normal way to build SQL Server parameters- auto mapping handles straightforward result shapes for you
- custom mapping is there when you want full control
- strict auto mapping is available when you want closer result-shape checking
MooBulkis the batch-loading path for larger data movement work