SkillAgentSearch skills...

RepoDB

A hybrid ORM library for .NET.

Install / Use

/learn @mikependon/RepoDB

README

SolutionBuilds Version Releases UnitTests IntegrationTests GitterChat

RepoDB - a hybrid ORM Library for .NET.

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.

To get the latest updates about this library, follow us on Twitter!

Benefits/Advantages

Like with any other ORMs, RepoDB does provide the preliminary methods needed for your basic operations. The good thing is, it also does provide the operations that is needed to cater your edge-cases like 2nd-Layer Cache, Tracing, Repositories, Property Handlers and Batch/Bulk Operations.

If you are to use RepoDB, your development experience is as simple as opening a connection and calling the advance operations with a very minimal code. It is the reason that makes this library the simpliest ORM to use.

When you do the bulk operations, the generated value of the identity columns will be set back to the data models, just right after your execution. It is an important use-case that is/may needed by you and/or most developers, and both the BulkInsert and BulkMerge operations addressed this need.

RepoDB also does support the different way-of-executions (the atomic, the batch and the bulk). Through this, it is easy for you to establish your repository that can process the smallest-to-the-largest datasets without even affecting the efficiency and the performance of your application.

<details> <summary><b>Important Attributes</b></summary> <p>

Easy to Use - the operations were all implemented as extension methods of your IDbConnection object. For as long your connection is open, any operations can then be called against your database.

High Performant - it caches the already-generated compiled expressions for future reusabilities and executions. It understands your schema to create the most optimal compiled expression AOT.

Memory Efficient - it extracts and caches your object properties, execution contexts, object mappings and SQL statements. It is reusing them all throughout the process of transformations and executions.

Dynamic and Hybrid - it provides some advance features of the full-fledged ORMs. It significantly help the developers to simplify the experience when context-switching during the development.

Open-Source Software - it is an open-source software and will always be free. It is authored to further improve the .NET data access experiences and solutions, together with the collective ideas of the community.

High Quality - it is a high-quality micro-ORM supported by 10K+ real-life Unit and Integration Tests. It is highly tested and is used by various critical systems that are running in the Production environment.

</p> </details>

Get Started

Please click any of the link below to fast-track your learnings.

Or, learn a specific feature.

Otherwise, please visit our documentation page to learn more.

Supported Databases

The execute methods below support all the RDBMS data providers.

Whereas the fluent methods below only support the SQL Server, SQLite, MySQL and PostgreSQL RDBMS data providers.

Click here to see all the operations.

Package Referencing

By default, .NET is auto-resolving the references, however, we strongly recommend that you always explicitly reference the RepoDb core library. The rationale behind this is that, the RepoDb core library is a fast-moving package in which all the alpha/beta releases, hotfixes and/or even the actual releases could happen without affecting the extension libraries.

Please note that we are releasing an actual next released-version if the changes are having minimal impact but is important for the other users.

You can always target the version when installing the library, even it is on a semantic release.

> Install-Package RepoDb -version 1.x.x-betaX

.NET Type Coercion

By default, RepoDB does not do the automatic .NET CLR Type conversion during the serialization and deserialization process. The coercion support is completely dependent to the ADO.NET coercion capability.

It is in purpose to strictly notify you (as a library user) the design and/or the implementation problem of the entity model if being compared to its corresponding database table/view.

If you wish to have an automatic conversion, simply set the Converter.ConversionType property to Automatic.

RepoDb.Converter.ConversionType = ConversionType.Automatic;

Note: The exception that is being thrown is dependent to what the underlying ADO.NET coercion exception. If the Automatic conversion is used, the extracted value will always be evaluated and an additional conversion logic will be used (if needed). The conversion logic is through the AOT compilation of System.Linq.Expressions.Expression.Convert and/or System.Convert.

Exception Handling

As the compiler exception is a bit low-level and is not descriptive for the native language, therefore, when compiling the process of hydration from/to the database and the application, a customized exception is being thrown to provide a detailed exception messages to the callers.

On the other hand, as part of the standard when writing code in RepoDB (i.e.: respect the default exception handling of .NET, ensure an unharmonized exception when bubbling up the exception messages), RepoDB does not contain a single line of code that catches and rethrowing any exception (try-catch statement). Any exception happens within the library whether it is an ADO.NET

View on GitHub
GitHub Stars1.9k
CategoryData
Updated2d ago
Forks132

Languages

C#

Security Score

100/100

Audited on Mar 26, 2026

No findings