A hybrid .NET ORM library for SQL Server.
Install
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard | |
| Other |
README
RepoDb.SqlServer - a hybrid .NET ORM library for SQL Server.
RepoDB is an open-source .NET ORM library that bridges the gaps of micro-ORMs and full-ORMs. It helps you simplify the switch-over of when to use the BASIC and ADVANCE operations during the development.
Important Pages
- GitHub Home Page - to learn more about the core library.
- SQL Server Guide - getting started with SQL Server
- All Documentation - comprehensive guides and references
Community Engagements
- GitHub - for any issues, requests and problems.
- StackOverflow - for any technical questions.
- Gitter Chat - for direct and live Q&A.
Dependencies
- Microsoft.Data.SqlClient - the data provider used for SqlServer.
- RepoDb - the core library of RepoDB.
License
- Copyright © 2019 - 2024 Michael Camara Pendon
- Copyright © 2025 - now Bert Huijben
Installation
At the Package Manager Console, write the command below.
> Install-Package AmpScm.RepoDb.SqlServer
See the SQL Server Guide for more information.
Get Started
First, RepoDB must be configured and SQL Server support loaded.
using RepoDb;
using Microsoft.Data.SqlClient;
GlobalConfiguration.Setup().UseSqlServer();
Note: This call must be done once during application startup.
After the bootstrap initialization, any library operation can then be called.
Query
using (var connection = new SqlConnection(ConnectionString))
{
var customer = connection.Query<Customer>(c => c.Id == 10045);
}
Insert
var customer = new Customer
{
FirstName = "John",
LastName = "Doe",
IsActive = true
};
using (var connection = new SqlConnection(ConnectionString))
{
var id = connection.Insert<Customer>(customer);
}
Update
using (var connection = new SqlConnection(ConnectionString))
{
var customer = connection.Query<Customer>(10045);
customer.FirstName = "John";
customer.LastUpdatedUtc = DateTime.UtcNow;
var affectedRows = connection.Update<Customer>(customer);
}
Delete
using (var connection = new SqlConnection(ConnectionString))
{
var customer = connection.Query<Customer>(10045);
var deletedCount = connection.Delete<Customer>(customer);
}
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.