Skip to main content
net8.0net9.0.NETStandard2.0

A hybrid .NET ORM library for SQL Server.

Published
Nov 22, 2024
1y ago
Total Downloads
41.5K
41,502

Install

dotnet add package AmpScm.RepoDb.SqlServer --version 1.14.0-alphaSD02
ProductVersions
.NET
net8.0net9.0
.NET Standard
netstandard2.0

README

SqlServerBuild SqlServerHome SqlServerVersion SqlServerReleases SqlServerUnitTests SqlServerIntegrationTests

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.
  • Website - docs, features, classes, references, releases and blogs.

Community Engagements

Dependencies

License

Apache-2.0 - Copyright © 2020 - Michael Camara Pendon


Installation

At the Package Manager Console, write the command below.

> Install-Package RepoDb.SqlServer

Or, visit our installation page for more information.

Get Started

First, the bootstrapper must be initialized.

RepoDb.SqlServerBootstrap.Initialize();

Note: The call must be done once.

After the bootstrap initialization, any library operation can then be called.

Or, visit the official get-started page for SQL Server.

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

v1.14.0-alphaSD01v1.14.0-alphaSD02
Added Dependencies
AmpScm.RepoDb(.NETStandard2.0)
Removed Dependencies
RepoDb(net8.0)
RepoDb(net9.0)
RepoDb(.NETStandard2.0)

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.The published metadata declares 40 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.