A hybrid ORM library for .NET.
Package: https://www.nuget.org/packages/RepoDb Documentation: https://repodb.readthedocs.io/en/latest/
Follow @mike_pendon at Twitter.
RepoDb alternatives and similar packages
Based on the "ORM" category.
Alternatively, view RepoDb alternatives based on common mentions on social networks and blogs.
9.9 5.1 L1 RepoDb VS DapperDapper - a simple object mapper for .Net [Moved to: https://github.com/DapperLib/Dapper]
9.8 9.9 L1 RepoDb VS Entity FrameworkEF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
8.7 8.8 RepoDb VS FreeSql🦄 .NET orm, Mysql orm, Postgresql orm, SqlServer orm, Oracle orm, Sqlite orm, Firebird orm, 达梦 orm, 人大金仓 orm, 神通 orm, 翰高 orm, 华为GaussDB orm, MsAccess orm.
8.0 7.4 L5 RepoDb VS Dapper ExtensionsDapper Extensions is a small library that complements Dapper by adding basic CRUD operations (Get, Insert, Update, Delete) for your POCOs. For more advanced querying scenarios, Dapper Extensions provides a predicate system. The goal of this library is to keep your POCOs pure by not requiring any attributes or base class inheritance.
7.7 7.5 RepoDb VS Entity Framework 6This is the codebase for Entity Framework 6 (previously maintained at https://entityframework.codeplex.com). Entity Framework Core is maintained at https://github.com/dotnet/efcore.
6.4 0.1 RepoDb VS SmartSqlSmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
5.4 8.0 RepoDb VS SQLProviderA general F# SQL database erasing type provider, supporting LINQ queries, schema exploration, individuals, CRUD operations and much more besides.
Repository abstraction layer on top of Official MongoDB C# driver
3.5 2.4 L3 RepoDb VS NReco.DataFast DB-independent DAL for .NET Core: abstract queries, SQL commands builder, schema-less data access, POCO mapping (micro-ORM).
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of RepoDb or a related project?
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!
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.
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.
Please click any of the link below to fast-track your learnings.
Or, learn a specific feature.
- Batch Operations
- Bulk Operations
- Class Handlers
- Class Mapping
- Connection Persistency
- Expression Trees
- Implicit Mapping
- Multiple Query
- Property Handlers
- Targeted Operations
- Type Mapping
Otherwise, please visit our documentation page to learn more.
The execute methods below support all the RDBMS data providers.
Click here to see all the operations.
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.
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.
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 exception and/or whatever will be bubble up natively back to the callers.
If you are working with this package, you are required to bootstrap the connection object on the startup.
var dbSetting = new SqlServerDbSetting(); DbSettingMapper .Add<System.Data.SqlClient.SqlConnection>(dbSetting, true); DbHelperMapper .Add<System.Data.SqlClient.SqlConnection>(new SqlServerDbHelper(), true); StatementBuilderMapper .Add<System.Data.SqlClient.SqlConnection>(new SqlServerStatementBuilder(dbSetting), true);
Or, you can replicate the actual SqlServerBootstrap class implementation and attach it to your solution. Then, call the local class initializer method explicitly.
It is very important for you and to the community of .NET to learn the things the library is capable and is-not capable of doing, so please spend time reading the limitation page before using the library.
The benchmark result shown on this section is the result of the community-approved ORM bencher tool, the RawDataAccessBencher tool.
Below is the actual recent official execution result.
RepoDB shows an impressive performance and memory-efficiency if being compared with other ORMs available in the .NET ecosystem. It has positioned itself just right behind the logic-less hand-coded materializer if being benchmark with .NET Core and .NET Framework. However, RepoDB is the fastest and the most-efficient ORM if being benchmark with .NET 5, even beating the hand-coded materializer.
The AOT compilation (IL/Expression) has some degree of performance impact, even just for milliseconds, therefore, if you are to materialize RepoDB, it is highly recommended to always eliminate the first execution.
To avoid the bias, you as well should exclude the first execution of the other ORMs during the benchmarking.
We would like to make RepoDB the mainstream hybrid-ORM library for .NET technology. Please help us build and realize the solution.
If you wish to contribute to the documentation site, it is hosted in the RepoDb.NET repository. Your expertise is needed to correct the forms, if needed.
Your biggest contribution is to utilize and share this library to the other developers.
- Blog it
- Discuss it
- Document it
- Share it
- Use it
Or, show your support by simply giving a :star: on this project.
Please get in touch with us via:
- GitHub - for any issues, requests and problems.
- StackOverflow - for any technical questions.
- Twitter - for the latest news.
- Gitter Chat - for direct and live Q&A.
Ensure to visit our Support Policy to get more details about our policies when handling the operational support for this library.
- Building the Solutions - let us build your copies.
- Coding Standards - let us be uniformed.
- Issuing a Pull-Request - let us be aligned and notified.
- Reporting an Issue - let us be organized for easy tracking and fixing.
Thanks to all the contributors of this project, and to Scott Hanselman for Exploring the .NET open source hybrid ORM library RepoDB.
And also, thanks to these awesome OSS projects.
- AppVeyor - for the builds and test-executions.
- GitHub - for hosting this project.
- Gitter - for the community engagements.
- Jekyll - for powering our website.
- Just-the-Docs - for being the awesome library documentation template.
- Moq - for being the tests mocking framework.
- Nuget - for the package deliveries.
- RawDataAccessBencher - for measuring the performance and efficiency.
- SharpLab - for helping us on our IL coding.
- Shields - for the awesome badges.
- StackEdit - for being the markdown file editor.
- Microsoft.Data.Sqlite, System.Data.SQLite.Core, MySql.Data, MySqlConnector, Npgsql - for being the extended DB provider drivers.
*Note that all licence references and agreements mentioned in the RepoDb README section above are relevant to that project's source code only.