RepoDb - a hybrid ORM library for .NET.
Tags: csharp, dotnet, sql, orm
Published: 2019-12-30 17:43:09

---
title: RepoDb - a hybrid ORM library for .NET.
published: true
description: A hybrid ORM library for .NET.
tags: csharp, dotnet, sql, beginner, orm
---

## Introduction

Introducing *RepoDb*, a new *high performant* and *efficient* hybrid ORM library for .NET.

To begin with, you can start reading our [Getting Started](https://github.com/mikependon/RepoDb/wiki/Getting-Started) page or learn more from our [documentation](https://repodb.readthedocs.io/en/latest/).

## Why use RepoDb? Your benefits!

- *Easy* installation, only takes few seconds.
- No controlled layer like *DbContext*, those make the developers *speed-up* the usability.
- Calls to *Fluent* and *Raw-SQL* methods is just a *dot* away.
- *Repository* implementation becomes more *simpler* by leveraging the built-in repositories.
- Can work *without* the models; everything can be *dynamics*.
- Ease of pain when working with *large* data sets.
- Minimizes the round trips with *2nd-Layer cache*.
- *Transmission* of data from *different* RDBMS DB Providers only take few lines of codes.

## How does it works?

Basically, all [*operations*](https://github.com/mikependon/RepoDb#operations) were implemented as extended methods of the *IDbConnection* object. Once you hold the opened-state of your database connection object, you can then do all the activities you would like to do with your database through those extended methods.

**See sample code snippets below:**

For *Query*.

```csharp
using (var connection = new SqlConnection(ConnectionString))
{
	var customer= connection.Query<Customer>(10045).FirstOrDefault();
}
```

For *Insert*.

```csharp
using (var connection = new SqlConnection(ConnectionString))
{
	var customer = new Customer
	{
		Name = "John Doe",
		Address = "New York"
	};
	var id = connection.Insert<Customer>(customer);
}
```

For *Update*.

```csharp
using (var connection = new SqlConnection(ConnectionString))
{
	var customer = new Customer
	{
		Id = 10045,
		Name = "Jane Doe",
		Address = "Chicago"
	};
	var rowsAffected = connection.Update<Customer>(customer);
}
```

And for *Delete*.

```csharp
using (var connection = new SqlConnection(ConnectionString))
{
	var deletedRows = connection.Delete<Customer>(10045);
}
```

You can also execute a *Raw SQLs* via *Execute* methods (ie: *ExecuteQuery*, *ExecuteNonQuery*, *ExecuteScalar* and *ExecuteReader*).

```csharp
using (var connection = new SqlConnection(ConnectionString))
{
	var customers = connection.ExecuteQuery<Customer>("SELECT * FROM [dbo].[Customer];");
}
```

Or even executing a *StoredProcedure*.

```csharp
using (var connection = new SqlConnection(ConnectionString))
{
	var customers = connection.ExecuteQuery<Customer>("sp_GetCustomersByState", new { State = "New York" }, commandType: CommandType.StoredProcedure);
}
```

## Core Features

It has a rich features that you can leverage and use during the development.
 
- Asynchronous Operations
- Batch Operations
- Bulk Operations
- Caching
- Connection Persistency
- Database Helpers
- Database Settings
- Expression Trees
- Extension Methods
- Field Mapping
- Inline Hints
- Massive Operations (Generics/Explicits/MethodCalls/TableBased)
- Multi-Resultset Query
- Query Builder
- Repositories
- Resolvers (CLR Types, DB Types)
- Statement Builder
- Tracing
- Transaction
- Type Mapping

To learn more about these [*operation*](https://github.com/mikependon/RepoDb#operations), please visit our [*reference implementations*](https://github.com/mikependon/RepoDb/blob/master/RepoDb.Docs/Reference%20Implementations.md) page.

## Database Supports

The library supports the *SqlServer*, *SqLite*, *MySql* and *PostgreSql (soon)* RDBMS data providers.

## Quality

It also covers a lot of real-world scenarios through its rich [*Unit Tests*](https://github.com/mikependon/RepoDb/tree/master/RepoDb.Core/RepoDb.Tests/RepoDb.UnitTests) and [*Integration Tests*](https://github.com/mikependon/RepoDb/tree/master/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests). 

## Feedback

Please let us know about your feedback if you have some.

Lastly, please do not forget to share this to your friends and colleagues; give us your valuable *Star* on our [*GitHub Repository*](https://github.com/mikependon/RepoDb).

-----------

We are here to engage more with the .NET Community and collaborate further for the development of this library.