Introduction
Introducing RepoDb, a new high performant and efficient hybrid ORM library for .NET.
To begin with, you can start reading our Getting Started page or learn more from our documentation.
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 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.
using (var connection = new SqlConnection(ConnectionString))
{
var customer= connection.Query<Customer>(10045).FirstOrDefault();
}
For Insert.
using (var connection = new SqlConnection(ConnectionString))
{
var customer = new Customer
{
Name = "John Doe",
Address = "New York"
};
var id = connection.Insert<Customer>(customer);
}
For Update.
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.
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).
using (var connection = new SqlConnection(ConnectionString))
{
var customers = connection.ExecuteQuery<Customer>("SELECT * FROM [dbo].[Customer];");
}
Or even executing a StoredProcedure.
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, please visit our reference implementations 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 and Integration Tests.
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.
We are here to engage more with the .NET Community and collaborate further for the development of this library.
Top comments (4)
Is RepoDb out of beta and in production?
It is already in Production and stable release as of v1.10.10.
When is Postgres to be supported?
Hi Ben, the PostgreSql is now supported, but only the latest one. Here is the project link that could lead you to the Nuget Package.
github.com/mikependon/RepoDb/tree/...